data input method using a script

Post general support questions here that do not specifically fall into the Linux or Windows categories.

Moderators: Developers, Moderators

Post Reply
morya
Posts: 21
Joined: Tue Mar 15, 2011 9:40 am
Location: Switzerland

data input method using a script

Post by morya »

Hello,

I've got a mysql query output looking like the following:

Customer:xxx ID:xxx Inbound:xxx Outbound:xxx
Customer:yyy ID:yyy Inbound:yyy Outbound:yyy
Customer:... ID:... Inbound:... Outbound:...

I've got the following perl script getting the data from a .txt file:

#!/usr/bin/perl

open (FILE, '/tmp/qosm_mrtg.txt');
while (<FILE>) {
chomp;
($customer, $techid, $IB, $OB) = split("\t");
print "Customer:$customer\t";
print "Techid:$techid\t";
print "IB:$IB\t";
print "OB:$OB\n";
}
close (FILE);
exit;

The ouptut is:

Customer:yann Techid:7070S IB:5741 OB:21329
Customer:lionel Techid:7063T IB:8810 OB:46515
Customer:julie Techid:7076R IB:7438 OB:66614
Customer:flo Techid:7076S IB:11930 OB:31974
Customer:joelle Techid:7065S IB:134 OB:758
Customer:seb Techid:70785 IB:15651 OB:46562
Customer:david Techid:7086R IB:1442 OB:10150

How can i modify it in order to use it with an XML data queries?

I want to use the Customer field as the input field and the rest as output fields. I will then be able to add graphs per customer. Is it doable?

Thanking you

morya
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Re: data input method using a script

Post by gandalf »

Please see 1st link of my sig. There's a walkthrough for XML Data Queries
R.
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests