Importing text file with no line delimiters

M

mikewilsonuk

Is there a way to import a text file with no line delimiters without
resorting to VBA? The file I need to import has field-width fields
padded with spaces. The first field of the next row starts immediately
after the end of the last field of the previous row -- there is nothing
to indicate the end of a line/record.

I have used the import wizard to import similar files with line
delimiters and it does just what I need. If there is a way to do the
same thing with this wretched delimiter-free file, I will be very
pleased to hear it.
 
B

Bernie Deitrick

Mike,

No, you need to use VBA, unless the file is less than 256 lines, in which case you could import it
to one cell (subject to the limitation of 32K characters), use Data / Text to columns, and then
transpose the resulting cells.

HTH,
Bernie
MS Excel MVP
 
M

mikewilsonuk

I feared that would be the answer and have already started learning the
minimum VBA I will need to do this.
 
B

Bernie Deitrick

No need to learn too much - post in the programming group, and you'll get a good start on it.
 
M

mikewilsonuk

I found some code (in the help I think), copied & pasted it, hacked it
around a bit and added a 'load file' button to the sheet. It works
fine. As you say, there wasn't too much to learn. Thanks for your
advice.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top