[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Sheflug] Extracing data from a file
> wheat22.poi
> i
> 8
> 296 208
> 306 220
> 354 202
> 347 188
>
> The second line is just a constant, and can be forgotten. The
> third line staes the number of data points that are given (two in each
> line after line 3). The first line is the filename.
Ahh... in that case your original spec was wrong, and I know grok the meaning of the last line ... because you originally said:
The number of a,b data points is specified by N (there are N a
and N b points).
but rather there are N/2 a points and N/2 b points. Simple fix in the perl script, after "print FILE $count;" add the line "$count = $count / 2";
Or instead of the above, you could combine that in the for() statement if you wanted to:
"$i < ($count / 2)"
Do you want the filename (id_string) in the output file as well? I've assumed not, but I'm sure you can work out how to add it if needed :)
Chris...
--
\ Chris Johnson \ NP: Delerium - 07. Lost Passion
\ cej [at] nightwolf.org.uk ~-----,
\ http://cej.nightwolf.org.uk/ ~-----------------------------------,
\ Redclaw chat - http://redclaw.org.uk - telnet redclaw.org.uk 2000 \____
___________________________________________________________________
Sheffield Linux User's Group -
http://www.sheflug.co.uk/mailfaq.html
GNU the choice of a complete generation.