|
From: Thomas S. <t.s...@fz...> - 2011-01-31 09:33:08
|
try this: set macro set term dumb vs="" ws="" plot 'aaa.txt' using ( \ vs=vs.'; v'.stringcolumn(1).'='.stringcolumn(1), \ ws=ws.'; w'.stringcolumn(1).'='.stringcolumn(2), \ $1):2 print "vs: |".vs."|" print "ws: |".ws."|" @vs @ws show var bsmile wrote: > > Dear All, > > I just asked something about mathematical operation, and Thomas gave me > very > useful hint. So let me ask something more advanced in my point of view. Is > it possible to define an array in gnuplot, and read each row of a file > into > the array, for example, > > 1 0.56 > 2 0.45 > 3 0.56 > 4 0.65 > > ? > >>From what I know, I would think of the following > > p 'aaa.txt' u ( 'v'.$1=$1, 'w'.$1=$1 ):2 > > and it seems that > > v1=1, w1=0.56 > v2=2, w2=0.45 > ... > > But if I run the code, it fails, complaining that ')' expected > > Any suggestions? > > Thanks, > > Sincerely, > Jon > ------------------------------------------------------------------------------ > Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)! > Finally, a world-class log management solution at an even better > price-free! > Download using promo code Free_Logger_4_Dev2Dev. Offer expires > February 28th, so secure your free ArcSight Logger TODAY! > http://p.sf.net/sfu/arcsight-sfd2d > _______________________________________________ > gnuplot-info mailing list > gnu...@li... > https://lists.sourceforge.net/lists/listinfo/gnuplot-info > > -- View this message in context: http://old.nabble.com/read-a-datafile-into-an-array%2C-is-it-possible--tp30804801p30804971.html Sent from the Gnuplot - User mailing list archive at Nabble.com. |