Re: selfcreating filenames for putput files? [message #38944] |
Fri, 02 April 2004 15:55 |
R.Bauer
Messages: 1424 Registered: November 1998
|
Senior Member |
|
|
Thomas Nehls wrote:
> hi there,
>
> I created a pro with which I can compute a list of different images. As
> a result of the computation I want to save the results in a File,
> which?s name should consist of the name of the input-file and a suffix
> indicating which result it is. File is a variable which contains
> alsready the filename of the input-file.
>
> like:
>
> write_tiff, file and"_1st_PC.tif", computed_image,ORIENTATION=2
>
> How can I connect the changing variable file with the constant suffix
> "_1st_PC.tif" ?
>
> Thank you very much!
> Tom
Welcome Thomas,
there are two possibilities
print,strjoin([file,'1st_PC.tif'],'_')
print,file+'_1st_PC.tif'
It is better to use a single quote ' because the double quote is used to
format numbers to octal numbers "10 is 8.
Reimar
--
Forschungszentrum Juelich
email: R.Bauer@fz-juelich.de
http://www.fz-juelich.de/icg/icg-i/
============================================================ ======
a IDL library at ForschungsZentrum Juelich
http://www.fz-juelich.de/icg/icg-i/idl_icglib/idl_lib_intro. html
|
|
|
Re: selfcreating filenames for putput files? [message #38953 is a reply to message #38944] |
Fri, 02 April 2004 08:51  |
btt
Messages: 345 Registered: December 2000
|
Senior Member |
|
|
Paul Van Delst wrote:
> Thomas Nehls wrote:
>
>> hi there,
>>
>> I created a pro with which I can compute a list of different images.
>> As a result of the computation I want to save the results in a File,
>> which�s name should consist of the name of the input-file and a suffix
>> indicating which result it is. File is a variable which contains
>> alsready the filename of the input-file.
>>
>> like:
>>
>
> write_tiff, file + '_1st_PC.tif', computed_image,ORIENTATION=2
>
> or, if you want to use the output filename somewhere else,
>
> outputfile = file + '_1st_PC.tif'
> write_tiff, outputfile, computed_image,ORIENTATION=2
>
Or, if you are in a loop...
For i = 0L, nResults-1 Do Begin
...doStuff...
outputfile = file + StrTrim(i,2) + '_PC.tif'
write_tiff, outputfile, computed_image,ORIENTATION=2
EndFor
|
|
|
Re: selfcreating filenames for putput files? [message #38954 is a reply to message #38953] |
Fri, 02 April 2004 08:22  |
Paul Van Delst[1]
Messages: 1157 Registered: April 2002
|
Senior Member |
|
|
Thomas Nehls wrote:
> hi there,
>
> I created a pro with which I can compute a list of different images. As
> a result of the computation I want to save the results in a File,
> which�s name should consist of the name of the input-file and a suffix
> indicating which result it is. File is a variable which contains
> alsready the filename of the input-file.
>
> like:
>
write_tiff, file + '_1st_PC.tif', computed_image,ORIENTATION=2
or, if you want to use the output filename somewhere else,
outputfile = file + '_1st_PC.tif'
write_tiff, outputfile, computed_image,ORIENTATION=2
|
|
|