View Full Version : read file separated by tab
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
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.
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>")
something like that anyway (my god its been years since i've done asp :) )
Powered by vBulletin® Version 4.2.2 Copyright © 2016 vBulletin Solutions, Inc. All rights reserved.