By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,646 Members | 2,105 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,646 IT Pros & Developers. It's quick & easy.

read specific line in text file

P: 92
Hi
I have a text file that has differnt information

to be more clear i hav eto say that i have three differnt kind of information.
the column name for all the information are same but there is number at the top that i can undestand whenere shall it go.
it looks like some thing like this

102
(There are some lines here that i do not need it)
A B C
aaa 2 3 5
bbb 1 4 6
ccc 3 1 5

103
(There are some lines here that i do not need it)
A B C
aaa 3 3 7
bbb 1 2 1
ccc 4 1 4

104
(There are some lines here that i do not need it)
A B C
aaa 4 1 5
bbb 3 1 1
ccc 2 3 7


their position in text file are all same.

thanks alot

P.S:(TO Killer): I solved that problems for IBM Terminal.
I did half of the job in marco in the Application and then half with access
i did a macro that will copy and select and append all the pages in my application and the paste it in a text file in access.
Dec 6 '07 #1
Share this Question
Share on Google+
7 Replies


debasisdas
Expert 5K+
P: 8,127
If you completely solved that ,then why you posted it here ?
Dec 6 '07 #2

P: 92
this is another problem. now i have problem with this text file. i said that i soved the problem with the IBM Terminal not textfile.
now i dont kno whow can i skip those lines that i do not need.

i would appreciate any help
Dec 6 '07 #3

P: 92
maybe i have to explain more

in my textfile i hav e3 differnt information that according to the information it has to go and sit in differnt table.

as i said the coulmn name is same for all and the position.
just if at the top it is 102 then it is for table 103 and 103 for 103 and .....

i dont know how can i read the lines i want. and skip the lines that i do not want.

thanks
Dec 6 '07 #4

P: 2
You need to add the items in your textfile into an array. Once the array is filled, you can call a specific part of the array using
Expand|Select|Wrap|Line Numbers
  1. Myarray(indexnumber)
Dec 9 '07 #5

Expert 5K+
P: 8,434
You need to add the items in your textfile into an array. Once the array is filled, you can call a specific part of the array using
Expand|Select|Wrap|Line Numbers
  1. Myarray(indexnumber)
Surely if you only want particular lines form the file, you would simply read the file line by line and only process the ones you want. Like...

Expand|Select|Wrap|Line Numbers
  1. Open File
  2. Do Until EOF
  3.   Read line from file
  4.   If line matches what I want ("102" or whatever) Then
  5.     Process this line
  6.   End If
  7. Loop
Dec 10 '07 #6

P: 92
Hi
thanks for the solution.
Dec 10 '07 #7

Expert 5K+
P: 8,434
thanks for the solution.
Glad we could help. :)
Dec 12 '07 #8

Post your reply

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