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

Home » Public Forums » archive » Re: array.FIELD reading ascii file - ERROR message???
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: array.FIELD reading ascii file - ERROR message??? [message #60205] Mon, 05 May 2008 06:27
Vince Hradil is currently offline  Vince Hradil
Messages: 574
Registered: December 1999
Senior Member
On May 5, 7:31 am, David Fanning <n...@dfanning.com> wrote:
> maffie writes:
>> Like always, I read in my ascii (.txt) files as follows:
>
>> input = file.txt'
>> res = read_ascii(input,
>> DELIMITER=' ',DATA_START=1,MISSING_VALUE=-9999)
>
>> This is working when checking with the print, res statement.
>
>> Now, I always extract columns from this file, while using the
>> following statement
>> year = reform(res.field01(0,*)) or year = reform(res.field(0,*))
>
>> As I am not completely sure how this FIELD statement is working, I was
>> hoping on some help? Because in this case, I get the following ERROR
>> message:
>
>> % Tag name FIELD01 is undefined for structure <Anonymous>.
>
>> And I have no idea why? Normally, if I have this message, I change
>> from field 01 to field, and than it works. This time, it doesn't.
>
>> Could anybody help me with this?
>
> IDL> HELP, res, /STRUCTURE
>
> Cheers,
>
> David
>
> --
> David Fanning, Ph.D.
> Fanning Software Consulting, Inc.
> Coyote's Guide to IDL Programming:http://www.dfanning.com/
> Sepore ma de ni thui. ("Perhaps thou speakest truth.")

Or if you want to get it right programmatically try
year = reform((res.(0))[0,*])
Re: array.FIELD reading ascii file - ERROR message??? [message #60206 is a reply to message #60205] Mon, 05 May 2008 06:23 Go to previous message
matthias.demuzere is currently offline  matthias.demuzere
Messages: 32
Registered: January 2006
Member
On May 5, 2:31 pm, David Fanning <n...@dfanning.com> wrote:
> maffie writes:
>> Like always, I read in my ascii (.txt) files as follows:
>
>> input = file.txt'
>> res = read_ascii(input,
>> DELIMITER=' ',DATA_START=1,MISSING_VALUE=-9999)
>
>> This is working when checking with the print, res statement.
>
>> Now, I always extract columns from this file, while using the
>> following statement
>> year = reform(res.field01(0,*)) or year = reform(res.field(0,*))
>
>> As I am not completely sure how this FIELD statement is working, I was
>> hoping on some help? Because in this case, I get the following ERROR
>> message:
>
>> % Tag name FIELD01 is undefined for structure <Anonymous>.
>
>> And I have no idea why? Normally, if I have this message, I change
>> from field 01 to field, and than it works. This time, it doesn't.
>
>> Could anybody help me with this?
>
> IDL> HELP, res, /STRUCTURE
>
> Cheers,
>
> David
>
> --
> David Fanning, Ph.D.
> Fanning Software Consulting, Inc.
> Coyote's Guide to IDL Programming:http://www.dfanning.com/
> Sepore ma de ni thui. ("Perhaps thou speakest truth.")

Perfect!!

Thanks a lot David...
Re: array.FIELD reading ascii file - ERROR message??? [message #60208 is a reply to message #60206] Mon, 05 May 2008 05:31 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
maffie writes:

> Like always, I read in my ascii (.txt) files as follows:
>
> input = file.txt'
> res = read_ascii(input,
> DELIMITER=' ',DATA_START=1,MISSING_VALUE=-9999)
>
> This is working when checking with the print, res statement.
>
> Now, I always extract columns from this file, while using the
> following statement
> year = reform(res.field01(0,*)) or year = reform(res.field(0,*))
>
> As I am not completely sure how this FIELD statement is working, I was
> hoping on some help? Because in this case, I get the following ERROR
> message:
>
> % Tag name FIELD01 is undefined for structure <Anonymous>.
>
> And I have no idea why? Normally, if I have this message, I change
> from field 01 to field, and than it works. This time, it doesn't.
>
> Could anybody help me with this?

IDL> HELP, res, /STRUCTURE

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: array.FIELD reading ascii file - ERROR message???
Next Topic: Plot according to slopes?

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

Current Time: Wed Oct 08 18:56:32 PDT 2025

Total time taken to generate the page: 0.00537 seconds