Rank: 4742 based on 20 downloads (last 30 days) and 1 file submitted
photo

Paul Mattern

E-mail
Company/University
Dalhousie University

Personal Profile:

 

Watch this Author's files

 

Files Posted by Paul Mattern
Updated   File Tags Downloads
(last 30 days)
Comments Rating
17 Aug 2009 Screenshot DataTable store data in a table format that supports printing in plain text, Latex, HTML, Wiki,... Author: Paul Mattern data export, table, html, latex, wiki, potw 20 8
  • 4.75
4.8 | 4 ratings
Comments and Ratings by Paul Mattern View all
Updated File Comments Rating
13 Nov 2011 DataTable store data in a table format that supports printing in plain text, Latex, HTML, Wiki,... Author: Paul Mattern

Hi Yuri, thanks for your comment! Simple tab-delimited tables can already be made with current version:
>> dt = DataTable();
>> dt{1:3,1:3} = rand(3);
>> dt.toText('delimiter', char(9)) % char(9) is a tab

0.8147 0.9134 0.2785
0.9058 0.6324 0.5469
0.1270 0.0975 0.9575

Or are you looking for something else?

03 Aug 2011 DataTable store data in a table format that supports printing in plain text, Latex, HTML, Wiki,... Author: Paul Mattern

Hi Nicholaus,

the short answer is no, right now the TablePrinters get no information about the line number they are printing. So, it would require quite a bit of recoding to make it work. You could however use a (rather ugly) hack to get that extra \hline:

dt = DataTable();

... % fill table here

tmp = dt.getData(1,end);
dt{1,end} = sprintf('%g \\\\ \\hline %%', tmp{1});

dt.toLatex()

This might be enough for some quick printing of results, but of course it destroys the nice look of the table if you print it in any other format than Latex.

If some more people request a feature like this I may add it when I find some time.

17 Aug 2009 DataTable store data in a table format that supports printing in plain text, Latex, HTML, Wiki,... Author: Paul Mattern

Thanks for the comment. I just submitted the new version and it should be available shortly.

For a quick fix replace line 933 in DataTable.m:
strdata = myformat(this.applyColumnFormat());
by
strdata = this.standardFormat(this.applyColumnFormat());

More infos about the bug: The function "myformat" only exists on my computer and has been replaced by standardFormat in the DataTable class. Unfortunately I did not replace it everywhere.

Comments and Ratings on Paul Mattern's Files View all
Updated File Comment by Comments Rating
29 Nov 2011 DataTable store data in a table format that supports printing in plain text, Latex, HTML, Wiki,... Author: Paul Mattern Yuri K

Paul, thank you. Sorry for the late answer, I missed your reply.
Your solution leaves spaces on both sides of the delimiter. So it's actually
0.8147<space><tab><space>0.9134 etc.

13 Nov 2011 DataTable store data in a table format that supports printing in plain text, Latex, HTML, Wiki,... Author: Paul Mattern Paul Mattern

Hi Yuri, thanks for your comment! Simple tab-delimited tables can already be made with current version:
>> dt = DataTable();
>> dt{1:3,1:3} = rand(3);
>> dt.toText('delimiter', char(9)) % char(9) is a tab

0.8147 0.9134 0.2785
0.9058 0.6324 0.5469
0.1270 0.0975 0.9575

Or are you looking for something else?

02 Nov 2011 DataTable store data in a table format that supports printing in plain text, Latex, HTML, Wiki,... Author: Paul Mattern Yuri K

Paul, thanks for the great submission!

I don't think you need lines 448-451 since you process empty table inside the printer anyway.

I made a very simple TextFilePrinter to output the table to standard tab delimited text file. Hope you'd consider to include such functionality into the package.

03 Aug 2011 DataTable store data in a table format that supports printing in plain text, Latex, HTML, Wiki,... Author: Paul Mattern Paul Mattern

Hi Nicholaus,

the short answer is no, right now the TablePrinters get no information about the line number they are printing. So, it would require quite a bit of recoding to make it work. You could however use a (rather ugly) hack to get that extra \hline:

dt = DataTable();

... % fill table here

tmp = dt.getData(1,end);
dt{1,end} = sprintf('%g \\\\ \\hline %%', tmp{1});

dt.toLatex()

This might be enough for some quick printing of results, but of course it destroys the nice look of the table if you print it in any other format than Latex.

If some more people request a feature like this I may add it when I find some time.

03 Aug 2011 DataTable store data in a table format that supports printing in plain text, Latex, HTML, Wiki,... Author: Paul Mattern Nicholaus Halecky

Hey Paul,
Thanks much for this great function -- I have just implemented it for printing some results and it is working quite well. Quick question, I use latex often and was wondering if it is easy to make basic changes to the Latex TablePrinter class/method -- specifically, I wanted to have the option to an \hline after the first row, thus distinguishing row titles from the datasets. Any thoughts?
I really appreciate it.
Thanks again.

Contact us