Re: Can IDL create a plain text file? [message #51865 is a reply to message #51864] |
Thu, 14 December 2006 14:40   |
Matt[1]
Messages: 23 Registered: December 2006
|
Junior Member |
|
|
Thanks for the helpful responses and great leads. I'll give it a go.
Matt
www.landcover.org
On Dec 14, 5:24 pm, Christopher Thom <c...@oddjob.uchicago.edu> wrote:
> Hmmmm. Well, printing the stuff to the file is easy
>
> opewn, lun, 'myfile', /get_lun
> printf, lun, '"string in quotes"'
> free_lun, lun
>
> To append a parameter, say the contents of a variable myvar, you could
> use:
>
> str = '"string in quotes"'+strtrim(string(myvar),2)
> printf, lun, str
>
> the string() function converts myvar to a string, and strtrim() with the
> ",2" parameter trims the whitespace from the front and back. There are
> file_* routines that can help you construct the list of file -- see the
> help docs for those.
>
> cheers
> chris
>
> Quoth Matt:
>
>> I'm sorry david, it's not a trick question. I'm a geographer, not a
>> programmer, and one with about 2 months of IDL experience under my belt
>> to boot (and no other programming/scripting exposure at all). I think
>> I'm learning quickly, considering, and am finishing preparations to
>> process 4TB of satellite imagery. Nothing super high end, i'm sure, but
>> challenging nonetheless (at least to me).
>
>> A colleague mentioned that I should be able to create a text file in
>> IDL. Thie file will then be used as a paramater file for an ERDAS
>> Imagine script, which is called from IDL using SPAWN. Like I said
>> before, I've seen this done with PERL but given my deadlines I don't
>> have the time to go exploring PERL while still trying to learn IDL.
>
>> Silly question, I'm sure, but a real one nonetheless...
>
>> :-( indeed
>
>> Matt
>
>> On Dec 14, 4:13 pm, David Fanning <n...@dfanning.com> wrote:
>>> Matt writes:
>>>> Question - can IDL create a plain text file of a filelist following
>>>> user specifications? By this I mean that I'd like a text file listing
>>>> files in a directory, but would like to enclose file names in quotes
>>>> and add additional text to it. I imagine that this can be done by
>>>> calling a PERL script but I'm wondering if IDL can do it internally.This has GOT to be a trick question. I just can't
>>> see it though. :-(
>
>>> 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.")
|
|
|