I'm new to ledger and have thought on this same problem. I wrote a dirty 
shell script to invert the ledger equity report: 
https://gist.github.com/amarjen/10008046  

#!bin/bash                                                                      
                                               
> # Arguments: $1 --> Ledger source file                                        
>                                                  
> #            $2 --> Year Period, eg '2013'                                    
>                                                  
> #                                                                             
>                                                  
> # Example: bash ledger_close_year.sh mybooks.ledger 2013                      
>                                                     
>  
> # Equity report from ledger
> ledger -f $1 equity ^Income ^Expenses -p $2 > pl.tmp                          
>                                                    
>  
> # Invert equity report
> cat pl.tmp | awk 'NR==1 {print '"$2"' "/12/31 Year End Closing Entry"} NR>1 
> {$1="  "$1; $(NF-1)="  "$(NF-1);$NF=$NF*-1; print}' > closed.tmp              
>                                                                               
>                       
>  
> # Change the account name
> sed -i 's/Opening Balances/Retained Earnings/' closed.tmp                     
>                                                  
>  
> # Concatenate output with books in a new file
> cat $1 closed.tmp > $1.closed                                                 
>                                                  
>  
> # Clean temporal files
> rm pl.tmp closed.tmp    
>
>
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to