Solved

Loosing output of data to file

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
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 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…

743 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

12 Experts available now in Live!

Get 1:1 Help Now