Operating System - HP-UX
1756509 Members
2288 Online
108848 Solutions
New Discussion юеВ

methods to convert text data to line charts

 
SOLVED
Go to solution
Steve Post
Trusted Contributor

methods to convert text data to line charts

I have text files with data in it. I want to filter it, and make line charts by day (or month, or minute, or...).

Here's one way I could do it. I have the text files. I use perl to filter and reformat them. I take the new formated text file and use perl with a linechart module to plot it. Or I could take the formated text file and throw it into excel to make a line chart. This seems primitive to me. I'm doing a lot of manual processes. I would like to automate it.

On the other hand, I have tons of flexibility because it is so primitive. I wouldn't want a fancy program that refuses to let me specify what data I want to plot. For example, I would not expect a program to give me blocks per second on disk c3t2d0 daily at 9:02am without weekends from 1Feb2006 until now. But I would expect a program to plot a column of numbers by date.

So has somebody already gone down this road? What did YOU do?
2 REPLIES 2
James R. Ferguson
Acclaimed Contributor
Solution

Re: methods to convert text data to line charts

Hi Steve:

I use Perl to do the parsing, summarizing and formatting. I find nothing intrinsically wrong with taking that output and importing it into Excel to make graphs. In fact, that has been the road I have traveled too.

After all, the Unix way is to do one thing well, passing input and output down a chain (pipe) of tools you cobble together to affect a solution.

Certainly some folks use the GNU plotting tools and that's fine too.

REgards!

...JRF...
Steve Post
Trusted Contributor

Re: methods to convert text data to line charts

I waited on the points to see if anybody else would write.


It looks like gnuplot is exactly what I want.
I have the data in format:

mm/dd/yy ### ### ### ###
gnuplot> set xdata time
gnuplot> set timefmt "%m\/%d\/%y"
gnuplot> plot "day_7.dat" using 1:2 with lines,\
"day_7.dat" using 1:3 with lines,\
"day_7.dat" using 1:4 with lines

I hit return, and I get a nice graph.
Now I'm pretty sure I will be able to run gnuplot non-interactively from a perl script.
The biggest hurtle for me has been properly getting the date read in as the X axis. This gnuplot gets me past that hurtle.

thanks.
steve