473,320 Members | 1,976 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,320 software developers and data experts.

reading contets of file line by line

Hello friends
i want to read the contents of file line by line

how i can do that
Apr 5 '07 #1
4 1466
Expand|Select|Wrap|Line Numbers
  1.  
  2. getline(filename,lineoffile); //filename is the name of your file
  3.  
  4.                                        // lineoffile is the line of the file you want to read
  5.  
See if it works
Apr 5 '07 #2
Hello There,

I have a question regarding how to read the input from the text file, the calculate it and then write to the order text file as below:

China USA $15.00 $25.00 $35.00
Apr 29 '07 #3
Savage
1,764 Expert 1GB
Hello There,

I have a question regarding how to read the input from the text file, the calculate it and then write to the order text file as below:

China USA $15.00 $25.00 $35.00
It's a bit rude to ask question in someone else thread.

But,becasue it's on the same problem maybe we can answer u.

What have u tryed?
How does input file looks like?
Have u any experiance in file reading?
Do u know the basic algoritham for it?

In order for us to help u and therfore to help OP ,which has nearly the same problem, u must first help us by answering to those questions.

P.S:Don't post question in someone else thread in future becasue probably u will not get a answer.

Savage
Apr 29 '07 #4
Savage
1,764 Expert 1GB
Expand|Select|Wrap|Line Numbers
  1.  
  2. getline(filename,lineoffile); //filename is the name of your file
  3.  
  4.                                        // lineoffile is the line of the file you want to read
  5.  
See if it works
Just in case that OP don't know:

This all must be in a while loop which will loop until EOF.And lineoffile must be a array to store all that data.

Savage
Apr 29 '07 #5

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

Similar topics

4
by: Xah Lee | last post by:
# -*- coding: utf-8 -*- # Python # to open a file and write to file # do f=open('xfile.txt','w') # this creates a file "object" and name it f. # the second argument of open can be
11
by: Matt DeFoor | last post by:
I have some log files that I'm working with that look like this: 1000000000 3456 1234 1000000001 3456 1235 1000020002 3456 1223 1000203044 3456 986 etc. I'm trying to read the file...
6
by: KevinD | last post by:
assumption: I am new to C and old to COBOL I have been reading a lot (self teaching) but something is not sinking in with respect to reading a simple file - one record at a time. Using C, I am...
4
by: Ameya | last post by:
i want to read from a trace file ....but my problem is i am interested only in first 6 columns of my 10 - 12 wide text file. Each column is separated by a space (the number of columns vary on each...
40
by: googler | last post by:
I'm trying to read from an input text file and print it out. I can do this by reading each character, but I want to implement it in a more efficient way. So I thought my program should read one...
2
by: Sabin Finateanu | last post by:
Hi I'm having problem reading a file from my program and I think it's from a procedure I'm using but I don't see where I'm going wrong. Here is the code: public bool AllowUsage() { ...
17
by: aRTx | last post by:
I want to send sms from my sajt, i have some code but i don't know enaught. I have an account in one of sms service server ... code: <a href =...
21
by: Stephen.Schoenberger | last post by:
Hello, My C is a bit rusty (.NET programmer normally but need to do this in C) and I need to read in a text file that is setup as a table. The general form of the file is 00000000 USNIST00Z...
3
by: xyz | last post by:
Hi, I have a text file around 7GB includes 100 million lines... I want to read the data line by line when I approach my module.. ie., when i read for the first time , my program shuld read only...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.