|
-
Jan 29th, 2007, 10:13 PM
#1
Thread Starter
Lively Member
Read text file and write to another file
The original file format is like that:
Header
2.85667000
99.70000000
4.01666940
101.46667000
2
Decimal
1.01.33
Some description
EndHeader
START 43, L, 174=0;133=300000
100.81888000 3.85663000
100.81778000 3.85625000
100.80883000 3.85519000
STOP
START 43, L, 174=2;133=300000
101.29401000 3.20013000
101.29359000 3.20232000
101.29134000 3.20748000
STOP
i need to change it to another kind of format as below and save as another file by using visual basic 6.
2.85667000
99.70000000
4.01666940
101.46667000
Decimal
100.81888000 3.85663000 174=0
100.81778000 3.85625000 174=0
100.80883000 3.85519000 174=0
101.29401000 3.20013000 174=2
101.29359000 3.20232000 174=2
101.29134000 3.20748000 174=2
Last edited by junlo; Jan 30th, 2007 at 08:11 AM.
-
Feb 10th, 2007, 04:48 AM
#2
Re: Read text file and write to another file
My suggestion is read the text file line by line and parse it and write it to a new file.
Read text file contents (in four ways)
How to write text in a given text file (in two ways)
Last edited by cssriraman; Mar 8th, 2007 at 05:10 PM.
CS
-
Feb 10th, 2007, 11:13 AM
#3
Addicted Member
Re: Read text file and write to another file
-
Feb 16th, 2007, 06:22 AM
#4
Hyperactive Member
Re: Read text file and write to another file
 Originally Posted by cssriraman
My suggestion is read the text file line by line and parse it and write it to a new file.
How do you do that?
I read a couple of the links in your sig and didn't find them helpful since I don't know the first thing about this.
-
Feb 16th, 2007, 06:41 AM
#5
Re: Read text file and write to another file
 Originally Posted by disruptivehair
How do you do that?
I read a couple of the links in your sig and didn't find them helpful since I don't know the first thing about this.
Line Input, although it's about the slowest way to read a file ever invented.
The binary mode method demonstrated on his page is the quickest. Then you can use the Spit function to break it up into an array of lines.
To write to a file, open it in binary mode using the Access Write modifier, and use the Put statement.
Also, your CDs are sitting on my desk wrapped and ready to go, should be on their way in a day or two.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|