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

Home » Public Forums » archive » Re: Skipping Commented Line in 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: Skipping Commented Line in File [message #67585] Fri, 07 August 2009 10:31 Go to previous message
Gregory is currently offline  Gregory
Messages: 2
Registered: August 2009
Junior Member
On Aug 6, 4:45 pm, Vikram <vikramivat...@gmail.com> wrote:
> Hello,
>
> I was wondering if there is a way to skip a commented line in a .txt
> file, for example:
>
> #Count  Time
>   1         60
>   2         80
>   3         100
>
> I would like to start from the second row data and skip the labels.
>
> Thanks,
> Vikram

There is a command readcol in IDL Astronomy user's library which
is very convenient in cases like this. It skips comment lines and
reads each column in a separate vector. In this case all you need to
do would be:
readcol,'file.txt',count,time,format='f,f'
and you have all your numbers in Count column are in variable "count",
Time column is in "time".
The library is in http://idlastro.gsfc.nasa.gov/homepage.html

Gregory
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: Re: closing tabs of widget_tab()
Next Topic: Re: IDL PostScript Landscape Mode (Not!) Fixed

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

Current Time: Fri Oct 10 00:08:50 PDT 2025

Total time taken to generate the page: 0.00543 seconds