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

Home » Public Forums » archive » defining structure after ascii template
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: defining structure after ascii template [message #85880 is a reply to message #85879] Mon, 16 September 2013 10:02 Go to previous messageGo to previous message
spluque is currently offline  spluque
Messages: 33
Registered: September 2013
Member
On Monday, September 16, 2013 11:02:11 AM UTC-5, David Fanning wrote:
> spluque@gmail.com writes:
>
>
>
>> As far as I can see, it is not possible to define a structure using a template as the one built via ascii_template(). Essentially, extract a sub-structure from the template returned by ascii_template, containing the column names as tags and the field type. What is the proper way to do this?
>
>
>
> I honestly have no idea what this question means. Why don't you explain
>
> to us what you are trying to do.

Sorry for the terse initial post. Here is what I am trying to do:

1. I've prepared a template with ascii_template() for reading in an ASCII file via read_ascii().

2. Before reading the data with read_ascii(), I need to prepare an *array* of structures, where each element is a record (row) in a number of files to be read with the template in (1).

3. read_ascii() creates a structure that looks like this:

help, data, /structures
** Structure <57e3008>, 23 tags, length=7800864, data length=7800864, refs=1:
FIELD01 LONG Array[84792]
FIELD02 FLOAT Array[84792]
FIELD03 LONG Array[84792]
...[many more fields]

So the array of structures to be created would like this (abbreviating the number of fields for brevity here):

p={'foo', FIELD01:0L, FIELD02:0.0, FIELD03:0L}
replicate(p, n_recs)

where n_recs is the total number of records expected.

So the question is how can p be created from the information already there in the template created in (1)?

Thanks,
Seb
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Merits of different ways of 'extending' arrays
Next Topic: Import data in IDL from other source

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

Current Time: Thu Oct 09 20:09:32 PDT 2025

Total time taken to generate the page: 0.40144 seconds