I have a very specific question using csv files and GNUPlots.
What I am trying to do programmatically in Python, is print a set of graphs with gnuplots.
The specific problem I am trying to resolve is that I have csv files are a set of parsed data, processed from servers, with multiple columns.
In the first column there is a server names, some other columns which I do not need to care about right now, then my time columns and data columns.
What I am trying to is for each specific Server (let's call them A, B, and C) take the corresponding data for time and value - and plot these onto a gnuplot where each line is a separate server. So let's say the data looks something like 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 is simplified but accurate enough to pose solutions-- --Now this A B C formula - the pattern can vary, and number of times and such can vary so I cannot assume anything like every third server is the next server or something formulaic like this - so I need some kind of comparison or "checking" mechanism.
So what I need to do in gnuplott, is to match the first column and grab the x,y data from that row, for each instance of the server in that file, and rinse and repeat for each server in the file -- So I have a gnuplott of time vs data with all servers in the file.
After spending awhile on it - and reading the documentation I had considered using the ternary operator but - the issue I am having is that I am matching text fields - and then getting corresponding data by row in a csv.
The resolutions I have come to are just to parse the csv files by server into tempfiles - then simply plot the data from each temp file into the graph by using the simple plot column x column methodology in gnuplot ([x:y]) for each tempfile. I could just name the tmp files systematically, say after each server, and then access each feel assuming it has the server's name (or whatever naming convention I use to generate the tmp files).
What I really need is a way to do this more elegantly by using the gnuplott mechanism - instead of having to spend the memory and computational resources on writing - then parsing - temp files.
The tool this is part of is very costly in terms of computation and memory for other things the program is doing - so it would be MUCH better to avoid the process of -- Parse File - create temp files - plot temp file data for each file - destroy files
Let me know of any questions - or I need to explain better - I understand this a very long and specific question. I have read through the documentation (which is not great) among other sources - and frankly I am going forward with the tmp file approach until a better solution is proposed.
This is literally the first question I have ever asked on stackoverflow!
Thank you.