2
votes

I'm doing some simulations in OpenFOAM, using probes to get a time series of the velocity in a point. The output file has the following delimiter setup.

enter image description here

if it is possible, what would be the command to set the delimiter ?? when using gnuplot

set datafile separator '???'

Bonus info if I remove all ( and ) and use the default command the plot "plots"

plot "U" using 1:2
2
I don't know why the set datafile separator ' ()\t' doesn't work thoughbibi

2 Answers

2
votes

You can use

plot "U" using 1:2 "%lf (%lf %lf %lf)"

This format specifies your data format in the plot command. See help using for more details on this and the using examples for more complex examples.

If you don't want to type this each time, and you have a copy of gnuplot compiled with support for string macros, you also can do

dformat = "\"%lf (%lf %lf %lf)\""
plot "U" using 1:2 @dformat

which will expand the format specifier into the command. See help macros for more on this.

1
votes

I would suggest to use sed :

plot "< sed 's|[()]||g' U" u 1:2