plain text report output
Andrew Sackville-West
andrew at farwestbilliards.com
Mon Apr 3 15:01:25 EDT 2006
On Sat, 01 Apr 2006 12:23:30 -0500
TyrusMaynard <mayn at main.nc.us> wrote:
> I am still a newbie trying to grasp the ability of gnucash printing tools.
> I am learning my way through reports and wondering about the limitations for
> saving *plain text* to file with well ordered rows and columns.
>
> Even though the menu items for Edit> Copy|Paste are greyed out I
> "discovered" that I can copy and paste from the gnucash application display window.
>
> I hoped I could grab the neatly displayed rows and columns of a report for a
> similarly "neat" text file. Not so... the rows are neat, but the position of
> some fields are skewed according to the amount of characters in previous fields
> that compose the row. This means that a pasted text file has well aligned data
> for leftward columns of a "report" and worsening skew for text derived from
> rightward columns of a report. Now a piece of cake in the word processor of
> your choice becomes tortuous work. In many web pages, I find that sections of
> text that display well also maintains good order when copied and pasted into a
> text file.
> Can plain text alignment be improved in whatever code or style sheet that is
> used to generate a report (assuming such a report is HTML)?
> Presumably, this would involve design for good behavior of copy/paste ...not
> simply good design for the HTML displayed outcome.
>
> Isn't the *text file* an overlooked asset for report output? wouldn't it be
> handy to have a plain text output that is well aligned and can be further
> "beautified" in any word processor?
>
here's what I do:
export the report (button on toolbar)
save it as myreport
then at command line:
html2txt -nobs myreport | sed 's/,//g;s/ */,/g' > myreport.csv
note that this is three spaces --------^^^
or put it in a bash script called convert
#!/bin/bash
html2txt -nobs $1 | sed 's/,//g;s/ */,/g' > $1.csv
and just run "convert myreport"
this pulls the commas out of any monetary amounts, then removes any occurence of 2 or more spaces and replaces it with a comma. then it reads into your favorite spreadsheet just fine.
ymmv.
A
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 191 bytes
Desc: not available
Url : http://lists.gnucash.org/pipermail/gnucash-user/attachments/20060403/4d0546b8/attachment.bin
More information about the gnucash-user
mailing list