I'm trying to plot a very simple file that I constructed manually from a more complicated one.
file1 = 'easy.txt'
file2 = 'complicated.txt'
plot file1 u 1:2
-> leads to error that the xrange and yrange are empty, possibly because he is ignoring the rest of the lines after the first one
I believe it's a problem with the eol character, the complicated file originates from a measuring apparatus (I can check the exact name if necessary). I'm aware that E-13 is very small, I'm planning on ($2*10^(12)) to make it work (if that is necessary).
Gnuplot version 4.6 patchlevel 4, on an Ubuntu-machine (14.04)
I've been googling for the last 1,5h. I'm planning on using 'Set datafile commentschars "V" ' so I don't have to get rid of the first line every time I plot a file.
I really want to use gnuplot for this data since there are quite a few files coming up the road and Excel just annoys me to no end. Any help would be much appreciated :)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Your files have CR as end-of-line charater (old MAC style) whereas gnuplot expects LF (or CR/LF on Windows). You have to convert that first. Also your files have ',' as decimalsign. You can either convert those, too, or see set decimalsign. In version 4.6 you could also skip the first line in a datafile by using the every ::1 option. Version 5 onward have a skip option for that.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
alright, so it was actually the eof
do you know a simple way for conversion? I know a bit of python but not too well if I'm honest. But if I just read in line by line and write it back into a file, there shouldn't be an old eof-character right?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Not quite. Make that: it was actually the EOL (line). EOF is end-of-file. That can sometimes cause problems, too, but they're different ones.
But if I just read in line by line and write it back into a file, there shouldn't be an old eof-character right?
That depends entirely on how you do all that reading and writing of lines. There are ready-made tools for such conversions in a utility package named "dos2unix".
A more interesting question might would be how you came by a pre-OS-X Macintosh formatted file in this day and age. Those machines were old when the millennium came around...
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
yeah, the machine I used for recording the data IS really old, last service was 1998 I think^^ It still does its job pretty well though - it still uses floppy disks which is pretty funny
EOL yep I got that ;)
thanks for the quick help, I think I'll manage from here :)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I'm trying to plot a very simple file that I constructed manually from a more complicated one.
file1 = 'easy.txt'
file2 = 'complicated.txt'
plot file1 u 1:2
-> leads to error that the xrange and yrange are empty, possibly because he is ignoring the rest of the lines after the first one
I believe it's a problem with the eol character, the complicated file originates from a measuring apparatus (I can check the exact name if necessary). I'm aware that E-13 is very small, I'm planning on ($2*10^(12)) to make it work (if that is necessary).
FILES
I've been googling for the last 1,5h. I'm planning on using 'Set datafile commentschars "V" ' so I don't have to get rid of the first line every time I plot a file.
I really want to use gnuplot for this data since there are quite a few files coming up the road and Excel just annoys me to no end. Any help would be much appreciated :)
Your files have CR as end-of-line charater (old MAC style) whereas gnuplot expects LF (or CR/LF on Windows). You have to convert that first. Also your files have ',' as decimalsign. You can either convert those, too, or see
set decimalsign. In version 4.6 you could also skip the first line in a datafile by using theevery ::1option. Version 5 onward have askipoption for that.alright, so it was actually the eof
do you know a simple way for conversion? I know a bit of python but not too well if I'm honest. But if I just read in line by line and write it back into a file, there shouldn't be an old eof-character right?
Not quite. Make that: it was actually the EOL (line). EOF is end-of-file. That can sometimes cause problems, too, but they're different ones.
That depends entirely on how you do all that reading and writing of lines. There are ready-made tools for such conversions in a utility package named "dos2unix".
A more interesting question might would be how you came by a pre-OS-X Macintosh formatted file in this day and age. Those machines were old when the millennium came around...
yeah, the machine I used for recording the data IS really old, last service was 1998 I think^^ It still does its job pretty well though - it still uses floppy disks which is pretty funny
EOL yep I got that ;)
thanks for the quick help, I think I'll manage from here :)
just in case anybody comes across the same thing, a converter can be found here:
http://waterlan.home.xs4all.nl/dos2unix.html
bulk conversion is possible