KenCriss
Active Member
- Joined
- Jun 6, 2005
- Messages
- 326
I know how to read a text file from VBA and use the split function, but in this case, I want to take a portion of that input line to create a new line. For example, if this were my input line
4346123456789JOHN DOE 13154862 2
How could I write data out to another file such that I would have this:
4346123456789JOHN 13154862 2
4346123456789 DOE
I am basically trying to split the data but based on a certain numbered column in the file, not on a delimiter and move some data to a separate line when writing the data back out. Ideally I want to just write it back out to another text file, but I could put it into a worksheet also.
Do I need to do something like this
and then take "tmp" and try to split it for a certain number of chars?
4346123456789JOHN DOE 13154862 2
How could I write data out to another file such that I would have this:
4346123456789JOHN 13154862 2
4346123456789 DOE
I am basically trying to split the data but based on a certain numbered column in the file, not on a delimiter and move some data to a separate line when writing the data back out. Ideally I want to just write it back out to another text file, but I could put it into a worksheet also.
Do I need to do something like this
Code:
Line Input #1, tmp
and then take "tmp" and try to split it for a certain number of chars?