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

Home » Public Forums » archive » Re: read multiple files with varying names
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: read multiple files with varying names [message #66600] Mon, 25 May 2009 08:04 Go to previous message
Jean H. is currently offline  Jean H.
Messages: 472
Registered: July 2006
Senior Member
sophie.hoss@gmail.com wrote:
> hey guys
>
> probably a simple syntax question:
>
> i need to read multiple ascii files (all in one folder), with
> different names.
> e.g.
> ci0201.004
> ci0202.004
> ...
> do0201.004
>
> i want to read all of them that start with "ci", store them in one
> file, then read all of them that start with "do", store them and so
> on. (in order to extract data from them later on)

one way is to use file_search

print, file_search('ci*.004')

you can save the result to a new file.

Jean


>
> I used to read in files with readf in older programms, like
>
> openr, lun, 'filepath/*.dat', /GET_LUN
> header = strarr(3)
> READF, lun, header
>
> but there it wasnt necessary to "group" them, means to read only the
> ones starting with some specific letters...
>
>
>
> the other idea I had is simply to include an IF statement somewhere to
> exclude all files that DON'T start with the specific letter.
> But I'm SURE there's a more elegant solution to this.. I just don't
> know it :)
>
> thanks for your help
> sophie
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: Am I having a blackout?
Next Topic: How to extract latitude and longitude information from HDF file?

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

Current Time: Wed Oct 08 15:39:30 PDT 2025

Total time taken to generate the page: 0.00453 seconds