Welcome to iraf.net Thursday, May 09 2024 @ 09:12 PM GMT
kwkchan |
12/06/2009 03:50AM (Read 2185 times)
|
|
|
Status: offline
Registered: 10/02/2009
Posts: 12
|
Hi! I have another question, in my script I am inputing a file and I want to include a command so that my script will do a certain thing if the input file is a .txt file and do something else if the input file is a .fit file. Does anyone know what the command is?
|
|
|
|
fitz |
12/06/2009 03:50AM
|
|
|
Status: offline
Registered: 09/30/2005
Posts: 4040
|
You can use something like[code:1:fff426684d]
fname = "foo.fit"
len = strlen (fname)
extn = substr (fname, len-2, len)
if (extn == "fit") {
....something
} else if (extn == "txt") {
....something else
}
[/code:1:fff426684d]Another way to handle it is just to have separate parameters for images and text files and key off of whether the parameter is set.-Mike
|
|
|
|
| |
|
Content generated in: 0.08 seconds |
|