473,399 Members | 2,858 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,399 software developers and data experts.

.csv file to .txt file

ex:
input.csv (fp1)
anil,7.8
syam,9.2
kumar,6.9
suresh,8.6

FILE *fp1, *fp2;

fp1 = fopen ("input.csv", "r");
fp2r = fopen ("output.txt", "w");

fprintf(fp2, "Anil got %f GPA\n", anil);
fprintf(fp2, "Syam got %f GPA\n", syam);
fprintf(fp2, "Kumar got %f GPA\n", kumar);
fprintf(fp2, "Suresh got %f GPA\n", suresh);

In this condition i will take only before "," my variable and after "," variable value.
ex: if i entered anil in program it should be replesed with 7.8

output.txt (fp2)
Anil got 7.8 GPA.
syam got 9.2 GPA.
kumar got 6.9 GPA.
Suresh got 8.6 GPA.

Please let me explain this problem.
Nov 26 '18 #1
0 1025

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

Similar topics

3
by: jim | last post by:
I'm trying to stream a html page to the user as an excel file. I'm currently using Response.ContentType = "application/vnd.ms-excel" Response.AddHeader "Content-Disposition", "inline;...
9
by: ben | last post by:
Hello, This really drives me nuts. Im opening an input file, and Im testing if it was open successfully. Thats it! I know that the file that Im trying to open DOES NOT exist but Im getting NO...
11
by: Dica | last post by:
i'm getting an error about 'the process cannot access the file becaise it is being used by another process.' write after i've created a new file and try to open it for writing with xmlTextWriter....
3
by: Shapper | last post by:
Hello, I created a script to upload a file. To determine the file type I am using userPostedFile.ContentType. For example, for a png image I get "image/png". My questions are: 1. Where can...
4
by: Kavi | last post by:
i have a input type <input STYLE=font-size:10px; type=file name=filePath size=60 > and i have a file name Federal police have issued accused terrorist Jack Thomas with a control order,...
2
by: sani8888 | last post by:
Hi everybody I am a beginner with C++ programming. And I need some help. How can I start with this program *********** The program is using a text file of information as the source of the...
5
by: =?Utf-8?B?U3BlZWR5?= | last post by:
Sorry for aksing such a basic question but I have searched the internet high and low and none of the solutions seem to help. Here is my (not working) code: FileStream fs = new...
5
by: vshalpatel | last post by:
Hi I want to use SQL*Loader , an Oracle-supplied utility to load data from a flat file into one database tables. for this I have write the scripts in the SQL*LOADER control file named ...
2
by: helraizer1 | last post by:
Hi folks, I have a file for my chatbox called data.line, which the posts are in the layout CHATBOXTEXT 7 username=helraizer 1202416953
6
by: wxPythoner | last post by:
Hello! I have trouble understanding something in this code snippet: class TextReader: """Print and number lines in a text file.""" def __init__(self, file): self.file = file
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?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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
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.