...

View Full Version : read file separated by tab



esthera
07-04-2007, 07:04 PM
I have a file that has 2 collumns separated by a tab.
i want to convert this to an html table
how would I read a line and separate it that it's
<tr><td>coll 1 </td><td>col2</td></tr> for each line
my file is col1 tab col2 now

Daemonspyre
07-05-2007, 01:58 PM
In ASP, you can use the Scripting.FileSystemObject to search the file for chr(9) (tab) and vbCrLf (Carriage Return, Line Feed), then do a replace.

hinch
07-05-2007, 05:17 PM
the replace string would be something like
outputvar = "<tr><td>"
while readline whatever not EOF
outputvar=outputvar & replace(readintextfilecontents,vbTab,"</td><td>")
outputvar=outputvar & replace(readintextfilecontents,vbCRLF,"</td></tr>")
end while

something like that anyway (my god its been years since i've done asp :) )



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum