LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 100
Default Importing text file without end-of-line delimiter?


In Excel, I recorded a macro while importing a text file (because that's the
easiest way I've found to capture the fixed-width values for my fields). It
imported just fine.

Now I'm using VBA to import that same text file a line at a time and parse
each line for data values. I was having trouble (after the first line, the
code would quit). I used a msgbox to display that first line prior to
parsing- and it showed me the whole file! (or as much as could fit in a
msgbox, anyway).

So somehow, on importing the text file via the menu (file/open), Excel knew
that there were multiple lines and put the data in multiple rows. However,
when I use:

Do While Not EOF(1)
Line Input #1, LineofText
MsgBox LineofText
Loop

It opens the entire file as one line.

Clearly I'm missing something here, but I'm not sure what. Any suggestions?

Thank you,
Keith


 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Delimiter for csv and text file using ADO Jean-Yves[_2_] Excel Programming 1 December 22nd 06 08:37 AM
Importing text file with no line delimiters mikewilsonuk Excel Discussion (Misc queries) 4 June 15th 06 06:47 AM
Need Help Importing Text File Using Two or More Spaces as the Delimiter [email protected] Excel Discussion (Misc queries) 11 June 13th 06 02:08 AM
Need Help Importing Text File Using Two or More Spaces as the Delimiter [email protected] Excel Programming 11 June 13th 06 02:08 AM
Adding a delimiter when importing a txt file dfwboiler Excel Programming 0 March 27th 06 10:33 PM


All times are GMT +1. The time now is 01:56 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"