kamal has asked for the wisdom of the Perl Monks concerning the following question:
my $data = [ 2, 3, 4, 5, 6, 7 , 1, 4, 5, 2, 1, 5 , 3, 6, 7, 5, 4, 3 , ]; replacing the individual array by $csvdata[n]
1 The CSV file is :Date,Av,SEU,128,440,"1,024",Mixed,,rules profiling,snort,software version 7/14/2010,3.40,348,349.0,1254.9,3540.6,648.6,Mbps,on,s-2.8.6-38,4.9.1-229,,vs. 344,-1.22%,-0.02%,2.94%,0.79% 7/2/2010,3.40,344,353.3,1255.1,3439.4,643.5,Mbps,on,s-2.8.6-38,4.9.1-229,,vs. 343,0.37%,0.75%,-0.91%,-1.11% 6/30/2010,3.40,343,352.0,1245.8,3471.1,650.7,Mbps,on,s-2.8.6-38,4.9.1-229,,vs. 342,-0.26%,-0.91%,1.51%,-0.97% 6/24/2010,3.40,342,352.9,1257.2,3419.5,657.1,Mbps,on,s-2.8.6-38,4.9.1-229,,vs. 341,0.23%,0.50%,-1.34%,0.67%
2. i parse a csv file2. get $csvdatan 3 thru 6 and plot them against time so that X Axis is time Y axis is MBps and the 4 series, namely 128,440,"1,024",Mixed, and plotted against time plot the data using Spreadsheet::WriteExcel Thanks, -Kamal.#!/usr/bin/perl use strict; use warnings; use Tie::CSV_File; tie my @csvdata, 'Tie::CSV_File', 'perf.csv'; # print "Line 5, column 1: ", $csvdata[4][0] . "\n"; untie @csvdata;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: parse a csv file and create array of arrays and then plot the data
by ww (Archbishop) on Jul 20, 2010 at 11:58 UTC | |
by kamal (Sexton) on Jul 20, 2010 at 15:39 UTC | |
|
Re: parse a csv file and create array of arrays and then plot the data
by ambrus (Abbot) on Jul 20, 2010 at 11:54 UTC | |
|
Re: parse a csv file and create array of arrays and then plot the data
by jethro (Monsignor) on Jul 20, 2010 at 11:11 UTC |