Reading comma delimited text file

Results 1 to 3 of 3

Thread: Reading comma delimited text file

  1. #1
    Join Date
    Dec 1969

    Default Reading comma delimited text file

    Hi, I need to change this code from reading in a fixed space between fields file to read in a comma delimited text file. Here is the current code.<BR>do while not objImportFile.AtEndOfStream<BR>Response.Write objImportFile.Read(4) & "<BR>"<BR>loop<BR><BR>can anyone tell me what to change it to?

  2. #2
    Joe Kimbler Guest

    Default RE: Reading comma delimited text file

    Try writing something with the InStr command. It will return the position of the next instance of a character in a string. You can use InStr to detect each of the comma&#039s in a line.<BR><BR> could read the line into a variable and use the SPLIT comment to split the string at the comma&#039s into an array, then use LBound and UBound to make a loop to print it back out.<BR><BR>-Joe

  3. #3
    rajiv Guest

    Default RE: Reading comma delimited text file

    &nbsp;<BR>read the file one line at a time and then<BR><BR>if you want use javascript<BR>move the value into a string var and use var.split<BR>then user the array for whatever<BR>**********************<BR>function SplitDemo()<BR>{<BR> var s, ss;<BR> var s = "The quick brown fox jumped over the lazy yellow dog.";<BR> // Split at each space character.<BR> ss = s.split(" ");<BR> return(ss);<BR>}<BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts