Hi
I am trying to copy several rows of data from a text file. I have had a look through previous threads and cant find anything that explains how to copy more than one row over so I am hoping someone else can help me.
I have a large text file - I have attached a small extract. So far I have managed to search the file and import the digit 1 out of the first row "Matrix 1" (trust me thats progress). The next step I want to do is literally copy the proceeding 109 rows. Is this possible - I know I could do it manually but I have 350 files with a minimum of 16 of these matrices in each.
Hope you can help
Thanks
Rachael
How are you doing this?
Something like this
Where Data then is a text string?Open "c:\sim1.txt" For Input As #1 Do While Not EOF(1) Input #1, Data
If yes, the only way I know how to then get the information you need is to use VBA string functions like "LEFT" "MID" "INST" etc.
Yes darbid
At the minute i am searching for the string. I was worried that would be the case as the only way I could think to do it was to call each of the 109 lines in idividually and using this function which seems an awkward way round.
Just because I am saying it is the only way I KNOW how to do it does not mean it is the only way. I am happy for someone to tell me otherwise. At the moment it is the way I have handled such things.
The data is separated by multiple spaces. How would you expect that to import? Post an example workbook for the example text?
Microsoft MVP - Excel
Entia non sunt multiplicanda sine necessitate
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks