Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PERL/XML help

Status
Not open for further replies.

jodugg

Programmer
Jun 22, 2004
9
US
I have an array that contains data that is returned from a SQL query. I'm then looping through the data to create an XML spreadsheet.

The data returned from the SQL looks like this:

table_name field_name value count
order amt_paid A 500
order amt_paid B 500
club club_cd 1 500
club club_cd 2 500

Currently, the data is output to the spreadsheet row-by-row which is fine, except I'd like to add a blank row if the field_name changes. Example:

table_name field_name value count
order amt_paid A 500
order amt_paid B 500

club club_cd 1 500
club club_cd 2 500

Any ideas?
 
Why bother with the XML bit?

You could either do the query directly from Excel (I'm assuming you are using Excel here as you mention a spreadsheet) and then have a vba script which adds in the extra lines.

OR you could do the query in perl and output directly to the spreadsheet.

OK, I'm not an XML expert by any means, but it seems getting data, converting it to XML and then outputting it to something which doesnt use that XML is a bit pointless.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top