Solved

Loosing output of data to file

Posted on 2004-08-28
5
167 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 85

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 85

Accepted Solution

by:
Mike Tomlinson earned 125 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…

919 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now