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

Home » Public Forums » archive » putting .txt files in a structure
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: putting .txt files in a structure [message #91682 is a reply to message #91681] Wed, 12 August 2015 14:52 Go to previous messageGo to previous message
Paul Van Delst[1] is currently offline  Paul Van Delst[1]
Messages: 1157
Registered: April 2002
Senior Member
On 08/12/15 17:23, Wayana Dolan wrote:
> Hi Paul.
>
> You are correct in assuming that. I would like the text file as a
> whole to be part of the structure, so that when I hand off my structure
> to another person, they can know what all the variables are.

Ah. Well, then, you need to write code to read said text file, create
the (or a) structure based on what you read (e.g. tag names), and then
populate your newly created structure with values from the file.

It's a fair bit of work (in any language).

I would look at create_struct. It's what I use to read netcdf files into
a structure. Same deal as what you're doing apart from teh file format.

Other folks may have better/simpler ideas based on their experience.
E.g. is there a "read_*" function/procedure to do it?

cheers,

paulv

>
>
> On Wednesday, August 12, 2015 at 2:05:06 PM UTC-7, Paul van Delst wrote:
>> On 08/12/15 16:50, Wayana Dolan wrote:
>>> So I've created a structure which has a bunch of arrays (both
>>> string,
>>> and integer). I handwrote a file called readme.txt which explains all
>>> the variables in the structure. I can't get the file itself to become
>>> part of the structure.
>>
>> I'm not sure exactly what you mean by "get the file itself to become
>> part of the structure."
>>
>> Do you mean the file *name*? [easy]
>>
>> Or...
>>
>> Do you mean the file *contents*? [hard]
>>
>>> Part of the code looks like this (not the actual code, but similar..):
>>> btstruc={mm=momentmm,$
>>> ros=btstruc.ros, $
>>> readme=readme.txt}
>>>
>>> Everything works, except the text file!
>>
>> The above pseudo-code tells me you are trying to get the file *name* as
>> part of the structure.
>>
>> But somehow I don't think that's what you want....right?
>
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: No 8.4.1 or 8.5 release announcement
Next Topic: python bug??

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

Current Time: Wed Oct 08 14:08:20 PDT 2025

Total time taken to generate the page: 0.00205 seconds