python - Printing Only certain Rows from a CSV File in GNUPlott -
i have specific question using csv files , gnuplots.
what trying programmatically in python, print set of graphs gnuplots.
the specific problem trying resolve have csv files set of parsed data, processed servers, multiple columns.
in first column there server names, other columns not need care right now, time columns , data columns.
what trying each specific server (let's call them a, b, , c) take corresponding data time , value - , plot these onto gnuplot each line separate server. let's data looks this
server time data
a****** t1*** d1
a****** t2*** d2
a****** t3*** d3
b****** t1*** d1
b****** t2*** d2
b****** t3*** d3
c****** t1*** d1
c****** t2*** d2
c****** t3*** d3
--this simplified accurate enough pose solutions-- --now b c formula - pattern can vary, , number of times , such can vary cannot assume every third server next server or formulaic - need kind of comparison or "checking" mechanism.
so need in gnuplott, match first column , grab x,y data row, each instance of server in file, , rinse , repeat each server in file -- have gnuplott of time vs data servers in file.
after spending awhile on - , reading documentation had considered using ternary operator - issue having matching text fields - , getting corresponding data row in csv.
the resolutions have come parse csv files server tempfiles - plot data each temp file graph using simple plot column x column methodology in gnuplot ([x:y]) each tempfile. name tmp files systematically, after each server, , access each feel assuming has server's name (or whatever naming convention use generate tmp files).
what need way more elegantly using gnuplott mechanism - instead of having spend memory , computational resources on writing - parsing - temp files.
the tool part of costly in terms of computation , memory other things program doing - better avoid process of -- parse file - create temp files - plot temp file data each file - destroy files
let me know of questions - or need explain better - understand long , specific question. have read through documentation (which not great) among other sources - , frankly going forward tmp file approach until better solution proposed.
this literally first question have ever asked on stackoverflow!
thank you.
i haven't done such thing , haven't investigated issue in case helps:
1) pursue more ternary operator. other people similar problem managed successfully: gnuplot conditional plotting: plot col a:col b if col c == x or http://kevinhise.blogspot.com/2011/11/gnuplot-rows-conditionally-depending.html
2) agree temp files more demanding in terms of disk space computationally? not much, better check.
this literally first answer have ever given on stackoverflow. have checked links before in case peeks @ question , wouldn't have problems ternary operator pointed (the nature of don't understand after laconic description), may helpful.
Comments
Post a Comment