Solved

Loosing output of data to file

Posted on 2004-08-28
5
173 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 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 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: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

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…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
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…
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…

717 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