comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: How to skip lines when reading in a file
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: How to skip lines when reading in a file [message #74951] Mon, 07 February 2011 12:18 Go to previous message
Heinz Stege is currently offline  Heinz Stege
Messages: 189
Registered: January 2003
Senior Member
On Mon, 7 Feb 2011 10:10:40 -0800 (PST), Ashley Berg wrote:

> I have monthly mean temp data from Jan 1958 to Dec 2008 (1 col, 612
> rows). I want only the data from the months of December, January, and
> February in a new array, so the resulting time series will be one
> column by 153 rows. I'm not sure how to grab only those three months
> while ignoring the other 9. Could someone show me the best way to do
> this? Thank you!

What about something like:
array=all rows from file
array=reform(array,12,n_elements(array)/12,/overwrite)
array=array[[0,1,11],*] ; wanted months
array=array[*]

Not tested, simply written into the news reader.

HTH, Heinz
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: How to skip lines when reading in a file
Next Topic: Mock-up of the Book

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 19:10:35 PDT 2025

Total time taken to generate the page: 0.00537 seconds