LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 01-31-2008, 09:56 AM   #1
wolfipa
LQ Newbie
 
Registered: May 2004
Location: Austria
Distribution: Fedora Ubuntu OpenSuse
Posts: 26

Rep: Reputation: 15
create chart from csv file


hi,

i'm trying to create a graph from a csv file.
The file mainly has the date/time and a varying value
like:
Code:
1/30/2008 17:54:51,20
1/30/2008 17:54:54,24
1/30/2008 17:54:58,18
.
.
.
now i want to automatically convert this values into a chart graph.

Any ideas?
 
Old 01-31-2008, 11:34 AM   #2
makyo
Member
 
Registered: Aug 2006
Location: Saint Paul, MN, USA
Distribution: {Free,Open}BSD, CentOS, Debian, Fedora, Solaris, SuSE
Posts: 735

Rep: Reputation: 76
Hi.

I'm not sure what you mean by chart, but if you have not yet looked at gnuplot, I suggest that ... cheers, makyo
 
Old 01-31-2008, 12:17 PM   #3
teddyt
Member
 
Registered: Dec 2007
Location: US
Distribution: Slackware 12.1
Posts: 119

Rep: Reputation: 15
It's not clear how you want to put them into a chart (i.e., do you want to transform the data in some way).

If you just want to read in the data and plot the values after the comma, you can use Gnumeric, openoffice calc, or any spreadsheet. If the file has a .csv extension, Gnumeric will recognize that it is a csv file, and open the import wizard automatically. You can then plot the values using the "Insert a chart" button.
 
Old 01-31-2008, 01:05 PM   #4
wolfipa
LQ Newbie
 
Registered: May 2004
Location: Austria
Distribution: Fedora Ubuntu OpenSuse
Posts: 26

Original Poster
Rep: Reputation: 15
hi,

thanks for your answers. i want to automate the output - so when the csv file is created i want to start a program which produces a graphic file (doesn't matter which format ... png, jpeg, ...)
 
Old 01-31-2008, 06:34 PM   #5
pppaaarrrkkk
Member
 
Registered: Jun 2005
Location: Aylesbury UK
Distribution: Red Hat enterprise linux 6
Posts: 101

Rep: Reputation: 15
GNUplot - I've just been trying to use that. It only reads .dat files and I can't seem to find out how to convert a .csv to a .dat file
 
Old 01-31-2008, 06:38 PM   #6
pppaaarrrkkk
Member
 
Registered: Jun 2005
Location: Aylesbury UK
Distribution: Red Hat enterprise linux 6
Posts: 101

Rep: Reputation: 15
Actually, I think it's gnuplot, not GNUplot.
 
Old 01-31-2008, 07:59 PM   #7
makyo
Member
 
Registered: Aug 2006
Location: Saint Paul, MN, USA
Distribution: {Free,Open}BSD, CentOS, Debian, Fedora, Solaris, SuSE
Posts: 735

Rep: Reputation: 76
H.

Here's a sample script showing some degree of automation with gnuplot:
Code:
#!/bin/sh

# @(#) s4       Demonstrate ASCII output from gnuplot.
# See: http://www.gnuplot.info/
# for documentation and demos.

echo
echo " Sample bovine temperature:"
echo

sample -10 cow-temperatures |
tee t1

echo 'set terminal dumb 50 15 ; plot "t1"' | gnuplot

exit $?
Producing:
Code:
% ./s4

 Sample bovine temperature:

3       54
6       66
8       95
10      69
11      56
12      70
14      60
20      59
27      57
30      59


  95 ++-----+---A--+------+------+------+-----++
  90 ++     +      +      +      + "t1" + A   ++
  85 ++                                       ++
     |                                         |
  80 ++                                       ++
  75 ++                                       ++
  70 ++            A  A                       ++
  65 ++      A                                ++
     |                                         |
  60 ++                  A       A         A  +A
  55 ++  A  +      +A     +      +      +     ++
  50 ++-----+------+------+------+------+-----++
     0      5      10     15     20     25     30
Of course, you'd probably want a different output device, but this is convenient for pasting ... cheers, makyo

Last edited by makyo; 01-31-2008 at 08:02 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
load a csv file into postgresql sailu_mvn Linux - Server 5 03-26-2010 02:56 PM
LXer: Create impressive charts with Open Flash Chart LXer Syndicated Linux News 0 11-30-2007 04:30 PM
help extracting data from csv file willinusf Linux - General 10 10-27-2006 09:10 PM
csv to fixed-length file roballen Programming 0 03-11-2004 03:12 AM
CSV File AMMullan Programming 2 11-10-2003 12:49 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 03:40 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration