|
| |||||||||
| Tags: extract, grisbi, xml |
![]() |
| | Thread Tools | Search this Thread |
|
#1
| |||
| |||
| How to extract xml file generated by Grisbi
For those who know the software, I use Grisbi for my accounts. I want to extract the xml file generated by Grisbi of my accounts balances and this command line. xml file looks like this: <Accounts> <Account> ... <Balance_current> 99999999 <Balance_current> ... </Account> ... </Accounts> I found as xmllint utility, but I did not think it meets my necessities. If you have an idea then do help me! |
|
#2
| ||||
| ||||
| Re: How to extract xml file generated by Grisbi
The shell is not the best way to extract info from a XML file. Perl is much more responsive, and it is rather simple (XML:: Simple same). Here is a simple example that you can just copy paste it into a (pseudo) terminal: Code: cat > /tmp/l.xml <<WTF
<?xml version="1.0" ?>
<!DOCTYPE Foobar>
<Foobar Version="1.0">
<Accounts>
<Account>
<Balance_current>99999999</Balance_current>
</Account>
</Accounts>
</Foobar>
WTF
perl -MXML::Simple -e '$c = XMLin("/tmp/l.xml" ); print $c->{Accounts}->{Account}->{Balance_current}, "\n";' Code: # cpan -i XML::Simple Code: perldoc XML::Simple |
|
#3
| |||
| |||
| Re: How to extract xml file generated by Grisbi
I thought of perl but then my xml file is like this: <? xml version = "1.0"?> <Grisbi> and not this: <? xml version = "1.0"?> <! DOCTYPE Foobar> <Foobar Version="1.0"> The other problem is that if I have multiple accounts I have this error: Not a HASH reference at -e line 1. I think we should manage it in perl. |
|
#4
| ||||
| ||||
| Re: How to extract xml file generated by Grisbi
Consequently, you do not want to look Code: cat > /tmp/l.xml <<RTFM
<?xml version="1.0" ?>
<Grisbi>
<Accounts>
<Account>
<Balance_current>3,50$</Balance_current>
</Account>
</Accounts>
</Grisbi>
RTFM
perl -MXML::Simple -e '$c = XMLin("/tmp/l.xml" ); print $c->{Accounts}->{Account}->[1]->{Balance_current} ."\n";' |
![]() |
|
| Thread Tools | Search this Thread |
| |
Similar Threads for: "How to extract xml file generated by Grisbi" | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Avira Antivirus detects java generated text file as HTML/Silly.Gen | ROcHANn | Networking & Security | 5 | 01-06-2011 11:50 AM |
| How to use Kaspersky Anti virus to generated trace log file | Kallol | Networking & Security | 5 | 30-03-2010 02:49 AM |
| Access a file generated by server | Ash maker | Software Development | 5 | 25-01-2010 02:45 PM |
| How to extract a ape file | geokilla | Windows Software | 3 | 26-08-2009 01:27 PM |
| How to extract sfv file | King Leonidas | Windows Software | 2 | 18-06-2009 11:28 AM |