LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop
User Name
Password
Linux - Desktop This forum is for the discussion of all Linux Software used in a desktop context.

Notices


Reply
  Search this Thread
Old 05-17-2020, 01:40 AM   #1
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 7,312
Blog Entries: 3

Rep: Reputation: 3722Reputation: 3722Reputation: 3722Reputation: 3722Reputation: 3722Reputation: 3722Reputation: 3722Reputation: 3722Reputation: 3722Reputation: 3722Reputation: 3722
Patterns as GNUplot datafile separators?


In GNUplot, it is possible to set the delimiter for the input data to any single character by setting the datafile separator. I am wondering if it is possible to have it deal with a variable span of characters or even a fancier patter. The following built-in option allows it to deal with any single whitespace character,

Code:
set datafile separator whitespace
but it too chokes on multiple instances of that character. So gnuplot handles the first line below just fine, but treats the second line as if the fourth column were missing:

Code:
2020-05-17 06:35 20.812 21.937
2020-05-17 06:38 20.8   21.932
I could modify the way that input file is generated, but then it wrecks the visual flow in another conted. So, without resorting to pre-processing the data file, is there a way to get GNUplot to allow patters as data file separators?
 
Old 05-17-2020, 03:31 AM   #2
shruggy
Senior Member
 
Registered: Mar 2020
Posts: 3,670

Rep: Reputation: Disabled
Well, there's a possibility to invoke awk from inside GNUplot. Does it count as preprocessing?
 
1 members found this post helpful.
Old 05-17-2020, 06:42 AM   #3
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 7,312

Original Poster
Blog Entries: 3

Rep: Reputation: 3722Reputation: 3722Reputation: 3722Reputation: 3722Reputation: 3722Reputation: 3722Reputation: 3722Reputation: 3722Reputation: 3722Reputation: 3722Reputation: 3722
Very interesting. Piped-data for gnuplot is buried deep down in the gnuplot manual and I would not have seen that section otherwise. Thanks. I wish that their manual was HTML too not just PDF.

However, looking at the two scripts and four files involved, I think it'll just be better to adjust my workflow a little for now. I see some big changes which I can make but will procrastinate on refactoring for a while longer and just make a few tweaks instead.
 
  


Reply

Tags
datafile, delimiter, gnuplot, separator



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
[SOLVED] making a gnuplot 3d graph or gnuplot fence plot Rinndalir Programming 3 10-23-2015 01:10 PM
[SOLVED] gnuplot basic graph problem - noob to gnuplot sudowtf Linux - General 2 04-02-2015 11:00 AM
datafile recovery in Oracle on centos kapil17october Linux - Server 1 01-03-2013 07:29 AM
[SOLVED] Move MySql datafile to different location ethereal1m Slackware 2 08-28-2010 12:01 AM
How to corrupt the datafile in Oracle Ejdaha Linux - Newbie 2 03-01-2010 07:15 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop

All times are GMT -5. The time now is 11:19 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