?
Solved

Loosing output of data to file

Posted on 2004-08-28
5
Medium Priority
?
181 Views
Last Modified: 2010-05-02
I'm read all the files in a folder and outputing the list to a text file using:

   outFile.WriteLine (FileName)

I'm hitting a problem with one of the file names as a , (comma) in it and its not writing the last of the file name, so when i try and read it back i cant find the file.

ideas?

`Andy
0
Comment
Question by:xizor
  • 3
  • 2
5 Comments
 
LVL 86

Expert Comment

by:Mike Tomlinson
ID: 11921520
Can you post your writing and reading code?

Idle_Mind
0
 
LVL 2

Author Comment

by:xizor
ID: 11921582
hmm... good point, I shouldn't make assumptions, I double checked my output file and its fine, the input again is failing me.


im just using

open datafile for input as #1
do while not eof(1)
input #1, ItemData
ProcessData
loop

so the ipnut is stopping at the , in the file...

how do i get around this and read in the entire line of text?

`Andy
0
 
LVL 86

Accepted Solution

by:
Mike Tomlinson earned 500 total points
ID: 11921651
If you have one filename per line then it is simply:

Open datafile For Input As #1
Do While Not Eof(1)
    Line Input #1, ItemData
    ProcessData
Loop
Close #1

Idle_Mind
0
 
LVL 2

Author Comment

by:xizor
ID: 11921654
ok, found the answer.

the way around it is instead of using

Input #1, ItemData


use:

Line Input #1, ItemData


If anyone else has a better way, I'm all ears...
0
 
LVL 2

Author Comment

by:xizor
ID: 11921657
hehe, thanks, i just found it as you posted i guess

thanks.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Suggested Courses

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question