Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Skipping data file with no valid points

1,907 views
Skip to first unread message

erikz...@gmail.com

unread,
Nov 4, 2012, 6:16:44 PM11/4/12
to
Hello,

I have a single .xlsx file that contains the data I'd like to plot. After reading Gnuplot in Action I only see Janert using .dat & .txt file formats. So, on my mac I 'save as' to .txt 'tab delimited' (as opposed to the other two .txt options of MS-DOS & Windows formatted). Then I navigate to the directory of interest in Terminal, launch gnuplot and type -- plot "trial.txt" u 1:3 w lp -- with no luck (warning: Skipping data file with no valid points).

I tried adding a # to the first line. I tried alternative .txt formats. I manually re-created the first ten entries in my TextEdit app only to find out there is no save as option for .txt files (wtf?). Then I re-created in Xcode which saved it with no file extension BUT it plots as expected. Copying and pasting from the xlsx file into a blank Xcode file and saving also works as expected.

Can someone provide pointers so that I do not have to do this each time I want to play with my data?

In case it was not obvious, I am within my first 4 hours learning gnuplot - and Janert's book is great but I'm having trouble getting going with real data sets I'd like to analyze.

Thanks.

sfeam

unread,
Nov 4, 2012, 6:30:45 PM11/4/12
to
erikz...@gmail.com wrote:

> Hello,
>
> I have a single .xlsx file that contains the data I'd like to plot.
> After reading Gnuplot in Action I only see Janert using .dat & .txt
> file formats. So, on my mac I 'save as' to .txt 'tab delimited' (as
> opposed to the other two .txt options of MS-DOS & Windows formatted).
> Then I navigate to the directory of interest in Terminal, launch
> gnuplot and type -- plot "trial.txt" u 1:3 w lp -- with no luck
> (warning: Skipping data file with no valid points).

gnuplot> set datafile separator '\t'
gnuplot> plot ...

> I tried adding a # to the first line. I tried alternative .txt
> formats.

You might have to do that also, depending on the plot commands
you are using.

Ethan

erikz...@gmail.com

unread,
Nov 4, 2012, 7:20:15 PM11/4/12
to sf...@users.sourceforge.net

> gnuplot> set datafile separator '\t'
>
> gnuplot> plot ...

Tried '\t' but there was no change in end result. Tried "\t" to no effect as well. The file saved in Xcode worked with both though.

Thinking along the datafile separator line of thought I tried

gnuplot> set datafile separator ","

and save as to a .csv file extension, edited the first line to start with #, re-saved, and tried to plot

gnuplot> plot "trialc.csv" u 1:3 w lp

but it still didn't work. Tried removing the file extensions from the .txt & .csv but no luck as well regardless of datafile separator.

Alex van der Spek

unread,
Nov 6, 2012, 5:54:09 AM11/6/12
to
It would help if you could show us a sample of your datafile plus the actual
gnuplot code you are using.

In anycase the file extension has nothing to do with it.

Regards,
Alex van der Spek


<erikz...@gmail.com> wrote in message
news:b52df0f1-be67-4ae5...@googlegroups.com...

Erik Zweigle

unread,
Dec 7, 2012, 2:29:58 AM12/7/12
to
Turned out there were hidden ^M s in the file. Thanks to anothers help I was able to find and delete them in the VI editor.
0 new messages