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: 8
Default Opening a text file for input

Hi,

I do a lot of creating text files from Excel workbooks using "Open
blahblah for output as #1" and then printing to that file with "Print
#1, "etc"..

I now need to do some input from text files and don't know the syntax
& can't find it in HELP.

Specifically, I have a comma separated text file with an undefined
number of rows but always two fields.

What code would I need to achieve the following..

-Open a text file for reading
-Start a loop that will check line after line until the end of the
file
-Take both fields of a line of data (comma separated) and put each
field in a separate variable
-end the loop

I expect it would be something like this...(and I do know this does
nothing at the moment. I will be doing further manipulation of the
variables & dumping to another file later).

Open "c:\myfile.csv" for input as #1
Do while not EOF(myfile.csv)
read myfirstfield,mysecondfield
loop


Any help would be much appreciated.

Thanks.


 
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
Can I use a text input to define another file to reference? bob Excel Discussion (Misc queries) 5 October 6th 08 03:35 PM
Opening a file with User Input [email protected] Excel Discussion (Misc queries) 3 March 28th 07 03:00 AM
Opening a text file Khawajaanwar Excel Discussion (Misc queries) 8 June 14th 05 12:58 PM
Input from Text file BOMB3RMAN[_4_] Excel Programming 2 November 4th 03 03:00 AM
when opening a text file.... Excel[_3_] Excel Programming 0 October 2nd 03 03:24 AM


All times are GMT +1. The time now is 08:16 AM.

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

About Us

"It's about Microsoft Excel"