Import partial record from text file string

  • Thread starter Thread starter goss
  • Start date Start date
G

goss

Thanks Tom.
As always, I appreciate your mastery.

Seems text document is wrapping lines
Notepad tells me 9500 lines
However, output to xl ends at row 5499

I guess I thought the VBA would read the blank rows
and output those as well.

Any comments
 
Excel will read blank lines in a text file. However, you may not have any.

If Notepad is wordwrapping long lines, that is only for readability
purposes. The single lines don't become two lines just because they are
displayed with word wrap. A line break is indicated by vbCRLF combination.
Line Input reads everything up to the vbCRLF combination.

from help on Line Input:
The Line Input # statement reads from a file one character at a time until
it encounters a carriage return (Chr(13)) or carriage return-linefeed
(Chr(13) + Chr(10)) sequence. Carriage return-linefeed sequences are skipped
rather than appended to the character string.
 

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

Back
Top