473,405 Members | 2,210 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

Need help in writing to a file with delimeter

72
Hi,

I have some different types of data like

Employee number
Employee Name
Employee sex
.
.
.
etc

These Data I will read from stdin.

These data I need to write to a file with pipe (|) as delimiter?
How can I do this? Is there any library function for this.
Please give me a pointer where I can get information on this.

Thanks,
Manjunath
Nov 23 '09 #1
3 1596
Banfa
9,065 Expert Mod 8TB
| is just a character, write it to the file. It only has special meaning on the command line of Dos, Windows and *nix boxes. It has no special meaning in C or C++.
Nov 23 '09 #2
manjuks
72
That means, there is no library function like fprintf. We need to write our own function to accomplish this.

Thanks,
Manjunath
Nov 23 '09 #3
Banfa
9,065 Expert Mod 8TB
Where do you think fprintf originated? :D

It's in C just check any standard library reference. But '|' has no special meaning in fprintf or any other C standard library function. The only characters with any special meaning in strings in C are \ which is the escape character indicating that what comes next has a special meaning and % which in *printf format strings starts a format specifier. There are no other characters in C that, taken alone, have special meanings in strings.
Nov 23 '09 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

21
by: tomasio | last post by:
Dear Group, The Site under the following link (http://tomasio.laudatio.com/temp/schiepek/index.html) displays as I want it to in IE 6 (under Win XP) but does not render correctly in Firefox...
4
by: sushi | last post by:
Hello, I want to make an http post request to a site. I want to pass a paramaeter having xml such as report=<abc>abc</abc> to it. When I try to do this, is gives exception. And If send...
10
by: Claud Balls | last post by:
I am splitting large files based on a text delimeter, but I don't want the delimeter left out of the string. For example if I had a string "NAME: Bill TOWN: Helena NAME: Frank TOWN: Helena" I...
1
by: Voronkov Konstantin | last post by:
Hello all! std::ostringstream stream; stream << 8080; std::string str = stream.str(); // str == "8 080" The code shown above in mine big program result the str variable value to
27
by: jeniffer | last post by:
I need to create an excel file through a C program and then to populate it.How can it be done?
4
by: Jacob Lyles | last post by:
Hello All, I'm trying to make a comment section on my website. However, I don't want to set up a MYSQL database to do so because I want to make it really simple, just a form that asks for their...
22
by: fniles | last post by:
I have a .CSV file (comma delimited) that I want to open using OLEDB, but I get the error "External table is not in the expected format." If I save the .CSV file to an .XLS file, I can open the...
3
by: sumaabey | last post by:
my code <? //include("../mysqlconnect.php"); $link = mysql_connect("localhost","root","") or die("Could not connect: " . mysql_error()); mysql_select_db("suma"); ...
2
by: alp3r | last post by:
Hi all, I have been developing windows form project. I have file like; "name", "Anderson1" "pass", "1514" "Scenario 1 - 1st Question - Ethical", "1-1eth | 1" "Scenario 1 - 1st Question -...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.