How can I read every line from the existed file.
eg.
the content of textfile:
serialnumber = " 50";
serialfile path = "C:\\doc\\";
errorfile path = "C:\\doc\\d\\";
I want to read "50" from the first line to SeNo, read ""C:\\doc\\ "from the second line to SePath, read "C:\\doc\\d\\" ifrom the third line to ErPath.
any idea how it can be achieved. thanks
8 6261
open file
Loop untill EOF
begin
read line
search in the line for '='
Now copy the remaining string in to Destination.
end
close file
How can I read every line from the existed file.
eg.
the content of textfile:
serialnumber = " 50";
serialfile path = "C:\\doc\\";
errorfile path = "C:\\doc\\d\\";
I want to read "50" from the first line to SeNo, read ""C:\\doc\\ "from the second line to SePath, read "C:\\doc\\d\\" ifrom the third line to ErPath.
any idea how it can be achieved. thanks
open file
Loop untill EOF
begin
read line
search in the line for '='
Now copy the remaining string in to Destination.
end
close file
And if you need help on the functions that go with kvbreddy's algorithm, I find this site to be very good with examples (I also like how they have the other functions in the library of the function (still with me?) you are looking up, off to the left of the screen).
open file
Loop untill EOF
begin
read line
search in the line for '='
Now copy the remaining string in to Destination.
end
close file
Hi kvbreddy;
Thanks. the problem is I could not workout readline command, and how can I do a search.
I would so appreciate if you could write this part of code for me.
Hi kvbreddy;
Thanks. the problem is I could not workout readline command, and how can I do a search.
I would so appreciate if you could write this part of code for me.
Sorry, but we can't do that. This is in C, right? What error messages did you get when you tried readline?
Sorry, but we can't do that. This is in C, right? What error messages did you get when you tried readline?
Sorry about that I did not mention it. it is in VC++.
error is identifier was not found.
Sorry about that I did not mention it. it is in VC++.
error is identifier was not found.
Can you post the segment where you use readline() in your code?
Is this written in C#? C and C# have readline functions - I don't believe C++ does... (Please anyone correct me if I'm wrong.)
Can you post the segment where you use readline() in your code?
Is this written in C#? C and C# have readline functions - I don't believe C++ does... (Please anyone correct me if I'm wrong.)
I actually have already worked out, but I chose another method by using strstr.
but I do want to konw how readline works in C++.
any ideas..thanks
I actually have already worked out, but I chose another method by using strstr.
but I do want to konw how readline works in C++.
any ideas..thanks
That was what was confusing me. To my knowledge, readline is not in C++. (Though I could be wrong - its happened several times recently)
I personally prefer getline.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: dmiller23462 |
last post by:
Hi again guys....
This is my first source of help, by far the best ASP intellectual
collective....Thanks in advance for any assistance...Anyway....
The forms I'm still working on (finishing...
|
by: Tim Bücker |
last post by:
Hello.
Is there a way to read a specified line in a textfile?
Something like TextReader.ReadTextLine(4);
It seems very odd to use
reader.ReadLine();
reader.ReadLine();
reader.ReadLine();...
|
by: eight02645999 |
last post by:
hi
wish to ask a qns on strip
i wish to strip all spaces in front of a line (in text file)
f = open("textfile","rU")
while (1):
line = f.readline().strip()
if line == '':
break
print line
|
by: Justme |
last post by:
Novice programmer needs help with using fgets to read and ignore the
first two lines of a file. I've gone thru the previous posting
regarding fgets, but none of them seems to help my situation.
I...
|
by: Kinbote |
last post by:
Hi,
I'm trying to make a function that opens a file, reads it in line by
line, puts each line into an malloc'd array, and returns the array. I
suspect I'm going about it in an atypical fashion, as...
|
by: saytri |
last post by:
Hi i'm a student studying java (i'm still a beginner). i have a project were i have to do a quiz with a set of questions. So i think that i have to type the questions in a textfile for example in...
|
by: Snoze |
last post by:
Hello, I'm trying to make an application with C# that writes and reads some lines of a text file, but I want to read one specific line and save the text in a string variable.
And the inverse...
|
by: Per Juul Larsen |
last post by:
Hi.
My Textfile looks like this
Variable 1
Variable 2
Variable 3
Variable 4
On opening the application it will read the textfile, and assign each
line of variable to at textfield in VB and...
|
by: Raymond Chiu |
last post by:
Dear all,
Now I have the simple task to read text file line by line into database (SQL
Server 2000).
If the text file is divided into different fields according to the number of
characters,...
|
by: DolphinDB |
last post by:
Tired of spending countless mintues downsampling your data? Look no further!
In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
|
by: ryjfgjl |
last post by:
ExcelToDatabase: batch import excel into database automatically...
|
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...
|
by: jfyes |
last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
|
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...
|
by: Defcon1945 |
last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
|
by: af34tf |
last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
|
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...
|
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...
| |