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

Home » Public Forums » archive » Re: file_search: need work around for filenames with square brackets [ ]
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: file_search: need work around for filenames with square brackets [ ] [message #66955] Mon, 15 June 2009 16:36 Go to previous message
Heinz Stege is currently offline  Heinz Stege
Messages: 189
Registered: January 2003
Senior Member
On Mon, 15 Jun 2009 15:09:15 -0700 (PDT), rklein wrote:

> I'd rather go sailing, but could you come back from the tennis court
> please and have a look at this idl journal:
>
> ; IDL Version 7.0, Microsoft Windows (Win32 x86 m32)
> ; Journal File for Administrator@FIFILSTEST
> ; Working directory: C:\FIFILS\Software\FlightSoftware
> ; Date: Mon Jun 15 21:58:08 2009
>
> print,file_search("K:\OBSERVATIONS\archiveData
> \20090403_095540\00098_153217_spiral162_@0078*")
> ;K:\OBSERVATIONS\archiveData
> \20090403_095540\00098_153217_spiral162_@0078_[4,-4]_lw.dff
> ;K:\OBSERVATIONS\archiveData
> \20090403_095540\00098_153217_spiral162_@0078_[4,-4]_lw.fit
> ;K:\OBSERVATIONS\archiveData
> \20090403_095540\00098_153217_spiral162_@0078_[4,-4]_lw.rff
> print,file_search("K:\OBSERVATIONS\archiveData
> \20090403_095540\00098_153217_spiral162_@0078_\[4,-4\]_lw.df f ")
> print,file_search("K:\OBSERVATIONS\archiveData
> \20090403_095540\00098_153217_spiral162_@0078_/[4,-4/]_lw.df f ")
> print,file_search('"K:\OBSERVATIONS\archiveData
> \20090403_095540\00098_153217_spiral162_@0078_[4,-4]_lw.dff"')
>
> Of course, I tried escaping the brackets, but it does not work as you
> can see from the above. May be I should have mentioned that I am
> running on Windows

The square brackets are interpreted as wildcards by file_search. You
can put a single square bracket into square brackets ("[[]" for "["
and "[]]" for "]") and file_search may do what you want.

Example:

print,file_search(" K:\OBSERVATIONS\archiveData\20090403_095540\00098_153217_spi ral162_@0078_[[]4,-4[]]_lw.dff ")

HTH, Heinz
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: IDLDOC 3.2 Index page not as interesting as it could be...
Next Topic: update variable in structure

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

Current Time: Sat Oct 11 08:29:31 PDT 2025

Total time taken to generate the page: 2.71910 seconds