Hi all,

I'm very happy to announce this new feature of txt2tags (r146): %!csv

If you want to show the contents of a CSV file (Google Contacts
export, Excel spreadsheets, etc) as a nice table on your txt2tags
document, all you have to do is:

    %!csv: myfile.csv

Just put this command anywhere inside the BODY of your document. Just
like you do today with %!include.

You can also restrict the command to a specific target, if needed:

    %!csv(html): myfile.csv

See the new command in action:

################################

$ cat simple.csv
one,two,three
um,dois,tres
ichi,ni,san

$ ################################

$ cat foo.t2t

My nice table:
%!csv: simple.csv

$ ################################

$ txt2tags -t txt -H -o- foo.t2t

My nice table:

  | one | two | three |
  | um | dois | tres |
  | ichi | ni | san  |

$ ################################

$ txt2tags -t xhtml -H -o- foo.t2t
<p>
My nice table:
</p>

<table border="1" cellpadding="4">
<tr>
<td>one</td>
<td>two</td>
<td>three</td>
</tr>
<tr>
<td>um</td>
<td>dois</td>
<td>tres</td>
</tr>
<tr>
<td>ichi</td>
<td>ni</td>
<td>san</td>
</tr>
</table>


Thank you VERY MUCH to Florent Gallaire, who brought this cool idea.


-- 
Aurélio | www.aurelio.net | @oreio

------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo
_______________________________________________
txt2tags-list mailing list
https://lists.sourceforge.net/lists/listinfo/txt2tags-list

Reply via email to