On Saturday 04 July 2009, Mark Shields wrote:
> On Sat, Jul 4, 2009 at 11:36 AM, Mick <[email protected]> wrote:
> > Hi All,
> >
> > I know that rrdtool dump will export the rrd data into XML, but is there
> > something to either directly or via rrdtool create a CSV file for me? 
> > Will probably want to run this on a cron job and email/save it.
> > --
> > Regards,
> > Mick
>
> Judging from a few cursory google searches, it won't output to CSV, but you
> can easily convert it.  Try piping the file/output to these commands
> (yanked
>
> from Cacti forums):
> | grep -v NaN | grep '<row>' | tr e ' ' \
> | awk {'print "Q"$2"qcq"$3"qcq"$9"Q"'} \
> | tr Q '"' | tr c ',' | tr q '"'"
>
> Haven't tested it, but looks like it should work.

Hmm, I don't think it gets anywhere:
=======================================
cat test.xml | grep -v NaN | grep '<row>' | tr e ' ' | awk 
{'print "Q"$2"qcq"$3"qcq"$9"Q"'} | tr Q '"' | tr c ',' | tr q '"'" > test.csv
>
=======================================

It just sits there at the > cursor.  I think it needs something more to it, or 
I am not feeding the XML file to it correctly?

-- 
Regards,
Mick

Attachment: signature.asc
Description: This is a digitally signed message part.

Reply via email to