|
From: Xiao-Yong J. <xj...@co...> - 2010-06-03 17:27:06
|
On Thu, 27 May 2010 19:07:06 +0200, Jan Nowack wrote: > Hi all, > i have to plot a lot of datafiles in which the position of the columns > could change. A change of the datafiles is not possible. So VarOne > could be e.g on Pos 1 in one file, then on Pos. 17. So i wrote a > script that writes the Variable Positions in a file like > VarOne=17 > VarTwo=12 > and load the file at the beginnning. That works fine, but now i have > to change some values by a factor. Something like > plot filename using 1:($2*1.1) > of course works. But it does not work with the User Variables, e.g. > plot filename using VarOne:($VarTwo*1.1) > Does anyone knows a solution? Hi, I don't know what is the best way to achieve this, but I found myself sometimes using a combination of 'sprintf' and 'eval'. In your case, I believe 'eval' would be suffice eval 'plot filename using '.VarOne.':($'.VarTow.'*1.1)' Best, Xiao-Yong > With best regards > Jan -- J c/* __o/* X <\ * (__ Y */\ < |