JafSoft Support Forums  
  Products:
AscToHTM (text to HTML) / AscToPDF (text to PDF) / AscToRTF (text to RTF) / Detagger (HTML to text and markup removal) 

 
  Forum options:
Forum Index  Register  Login  Search  FAQ  Log Out
Member options:
My Profile  Inbox  Member List  Address Book  My Subscription  My Forums 
 
 

Note: Some forums require a login other than "Guest" in order to post messages and replies


How to convert CSV data into an HTML or RTF table

 
Logged in as: Guest
Users viewing this topic: none
  Printable Version
All Forums > [Hints and Tips] > [Tutorials and "How To"s] > AscToHTM and AscToRTF > How to convert CSV data into an HTML or RTF table Page: [1]
Login
Message << Older Topic   Newer Topic >
How to convert CSV data into an HTML or RTF table - 3/20/2006 9:45:31 PM   
Jaf

 

Posts: 70
Joined: 2/1/2006
Status: offline
AscToHTM and AscToRTF can convert CSV data into HTML and RTF tables. respecively.

If the whole file is in CSV format, then set the "Input File type" on the main screen to be "Comma delimited data file".  In this mode every line in the file will be treated as a line in a CSV table, and each delimited value will be added to the next column of the table.

If running the console version, you can achieve the same effect by adding /COMMA to the command line, e.g.
a2hcons input.txt /COMMA

If only part of the file is in CSV format, this may be detected automatically, provided the CSV section is large enough (i.e. more than just a few lines), and that the CSV section is separated from the surrounding text by one or more blank lines.

Alternatively you can add pre-processor tags to the source text to tell the software that you want the enclosed text to be treated as a delimited table.
This is plain text outside the CSV section

$_$_BEGIN_DEMILITED_TABLE
header 1, header 2, header 3
----------------------------
column 1, column 2, column 3
column 1, "Column 2, with a comma in it", "Column 3 has a ""quoted"" value"
$_$_END_TABLE

this is more plain text

Notes:

(1) The $_$_BEGIN_DELIMITED_TABLE...$_$_END_TABLE commands must be at the start of a line, and not indented as shown above for clarity.
(2) If you insert a line of dashes near the top of the table, the lines above will be treated as header lines
(3) Cells with a comma in them should have their value placed in quotes.  Cells with a quote in them must also be placed in quotes, and the quoted themselves should be doubled (see above example)
(4) The software also supports tab-delimited data
(5) For more information, see the products' Tag Manual 

< Message edited by Jaf -- 5/27/2006 12:30:06 PM >
Post #: 1
Page:   [1]
All Forums > [Hints and Tips] > [Tutorials and "How To"s] > AscToHTM and AscToRTF > How to convert CSV data into an HTML or RTF table Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts