Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 1 of 1
  1. #1
    New to the CF scene
    Join Date
    Jul 2007
    Location
    Midwest
    Posts
    4
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Javascript Parsing text files

    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>
    Last edited by jrobexe; 07-09-2007 at 07:19 PM. Reason: columns did not retain structure


 

Posting Permissions

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