Solved

Loosing output of data to file

Posted on 2004-08-28
5
170 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone 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

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

756 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