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

Home » Public Forums » archive » Naming the file as open through dialogue_pickfile
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: Naming the file as open through dialogue_pickfile [message #92748 is a reply to message #92746] Tue, 23 February 2016 06:27 Go to previous messageGo to previous message
Burch is currently offline  Burch
Messages: 28
Registered: December 2013
Junior Member
On Monday, February 22, 2016 at 11:33:35 PM UTC-6, mj99...@gmail.com wrote:
> I am trying to read a file through the command
>
> path='C:\LWP\'
> file=dialog_pickfile(PATH =path,filter ='*TXT')
>
> which has data to read and it is stored in some array.
> The file names in the "PATH" folder has a sequence "A1.txt", "A2.txt", .... and 15 others.
>
> Now I want to store the data in some another file.
> I want to store data in a new sequence such as "MA1.txt", which suggests the file has been read.
> so i want to add "M" in the newly saved file name along with old file name.
>
> EX:
> "M"+ "(original file name)".TXT
>
> Is it possible in IDL 8.4 Win PC ?

Since the output of dialog_pickfile() is a string you can use strmid() to remove the path. For example,

IDL> print, file
C:\LWP\A1.txt
IDL> print, strmid(file, 7)
A1.txt
IDL> print, 'M' + strmid(file, 7)
MA1.txt

Further info on strmid() and other useful routines:
http://www.exelisvis.com/docs/STRMID.html
http://www.exelisvis.com/docs/routines-87.html

-Jeff
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: Summation Image arrays
Next Topic: disable content assist?

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

Current Time: Thu Oct 09 21:54:24 PDT 2025

Total time taken to generate the page: 1.76039 seconds