plain text report output

John Clements clements at brinckerhoff.org
Mon Apr 3 14:42:29 EDT 2006


On Apr 3, 2006, at 9:00 AM, gnucash-user-request at gnucash.org wrote:
>
> Message: 6
> Date: Mon, 03 Apr 2006 11:03:06 -0400
> From: Josh Sled <jsled at asynchronous.org>
> Subject: Re: plain text report output
> To: TyrusMaynard <mayn at main.nc.us>
> Cc: gnucash-user at gnucash.org
> Message-ID: <1144076586.1776.22.camel at phoenix>
> Content-Type: text/plain
>
> On Mon, 2006-04-03 at 09:43 -0400, TyrusMaynard wrote:
>>     Forgive me for reposting my need. I feared that the post was  
>> either doomed
>> to be ignored as April Fools content or that it was too lengthy a  
>> mix describing
>> both plain need and suggestive innuendo about improvement for  
>> gnucash. So I am
>
> No offense intended, but we don't need feature requests... we need
> patches.
>
>
>>    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?
>
> Yes, the HTML that the reports output can be modified; you can either
> make a copy of the report and tweak that, or tweak the report in- 
> place.
> However, it's not, presently, very easy to insert that new report into
> the mix. :(
>
> If I wanted the reports as text, I'd export them (as HTML) and use
> `lynx`, `links` or `w3m` to save the formatted output as text.
>
> In time this should be easier, as the reports should become templated
> output formatters rather than html-emitting programs.  Also, future
> reports implementation should embrace MVC for the reports even more  
> so.
> But that's just more feature-requesting, really. :)

FWIW:

I had this problem a few days ago (I wanted a comma-separated list to  
import into Excel), and
I wrote a short mzscheme script to transform the html output of a  
gnucash P&L report into what I wanted.

Here's the script I wrote:

http://www.ccs.neu.edu/home/clements/download/gnucash-export-scrape.ss

In order to apply it, you just need to

1) install mzscheme or drscheme (www.plt-scheme.org),
2) put this .ss file in the current directory, and run
3) mzscheme -fmv- gnucash-export-scrape.ss <name-of-html-file> <name- 
of-new-output-file>


*** HUGE CAVEAT ***

Frankly, you're nuts if you try to use something like this: it's a  
cheap one-off script, it will _only_ work for the vanilla P&L report,  
and you have to install mzscheme first.  Why did I bother posting  
this?  Perhaps just to show that it's fairly easy to transform html  
in an arbitrary way using mzscheme.

All the best,

John Clements




More information about the gnucash-user mailing list