I have started playing with this piping feature of ledger, and have seen that while it does avoid the paging, it does not avoid the line cropping. When an account is too long to fit into one line, ledger crops it automatically.
This can be somewhat prevented, by using the option to display things wider.

But once you reach that limit, you hit the problem.

So, for example, if you have an account named "Assets:Family:Budget:Vacation:Whatever" and this gets cropped to something like "Assets:Family:Budget:Vac..." you cannot do a command like "ledger register | grep Whatever".

I know this is a stupid example, but I guess you get the point.

What is the standard way to do this?
I know I can call ledger with python and execute a script on it.
I know I can use the xml option that will output the data in xml format, without the cropping.

But what I would like is to be able to use something as simple as piping, but without the cropping of lines. Let's say for example I want to save the output to a file, it makes no sense to have ledger crop the lines.


Regards, Stefan Tunsch


El 04/04/12 22:01, John Wiegley escribió:
Craig Earls<[email protected]>  writes:
I should add that if you redirect ledgers output to a file it doesn't page. It only does that when printing to stdout.
Or a bit more accurately: it only does that when displaying to a tty.  If you
pipe the output to another program, it doesn't invoke the pager then either.

John

Reply via email to