0

Hi there,

I'm reading the contents of a text document and saving all of the values (csv) into an array. My issue is that the very first article in the document is always being saved with "" appended to the beginning.

eg.

Text document reads:

Hello,Doctor,Name,Continue,Yesterday,Tomorrow

When it is brought into the array:

array(0) = Hello
array(1) = Doctor
array(2) = Name
etc.

As you can see it only affects the first entry.

Here's a code snippet from my project:

FileOpen(1, "quiz.txt", OpenMode.Input)

Do While Not EOF(1)
    numQuestions += 1

    ReDim Preserve questionInfo(numQuestions * 6 - 1)

    For counter As Integer = (numQuestions * 6 - 6) To (numQuestions * 6 - 1)
        Input(1, questionInfo(counter))
    Next
Loop

FileClose(1)

Any help at all is of course greatly appreciated!

3
Contributors
2
Replies
3
Views
4 Years
Discussion Span
Last Post by Reverend Jim
0

Hi,

It looks like you are picking up some sort of formatting code or something. Have you tried opening the file in notepad? Are the characters appearing in the file in Notepad? I've had trouble in the past like this with csv files generated by excel especially if some sort of data sort was applied on it.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.