...

View Full Version : Javascript Parsing text files



jrobexe
07-09-2007, 07:18 PM
I have a text file generated by another application. It is formatted into columns of (text) numbers. I need to parse and convert into numbers the columns so that column math can be performed. I have an import utility that converts the text file into an html file, but it just creates text between <pre> tags.

How do I parse and retain the column structure?

Example:
<pre>
InsType Count TotSLif TotJLif TotSDis TotJDis
----------------------------------------------------------------------------------------------------
01 866 6,542.50 0.00 0.00 0.00
02 377 0.00 5,708.68 0.00 0.00
03 98 0.00 0.00 1,453.27 0.00
04 247 0.00 0.00 3,607.61 0.00
05 389 1,374.38 0.00 4,791.80 0.00
06 75 0.00 766.08 1,777.46 0.00
07 1,264 6,712.43 0.00 14,369.00 0.00
08 293 0.00 3,027.72 4,346.38
</pre>



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum