Welcome to iraf.net Thursday, May 09 2024 @ 09:12 PM GMT


 Forum Index > Help Desk > Systems New Topic Post Reply
 script command
   
kwkchan
 12/06/2009 03:50AM (Read 2185 times)  
+----
Newbie

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?

 
Profile Email
 Quote
fitz
 12/06/2009 03:50AM  
AAAAA
Admin

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

 
Profile Email
 Quote
   
Content generated in: 0.08 seconds
New Topic Post Reply

Normal Topic Normal Topic
Sticky Topic Sticky Topic
Locked Topic Locked Topic
New Post New Post
Sticky Topic W/ New Post Sticky Topic W/ New Post
Locked Topic W/ New Post Locked Topic W/ New Post
View Anonymous Posts 
Anonymous users can post 
Filtered HTML Allowed 
Censored Content 
dog allergies remedies cialis 20 mg chilblain remedies


Privacy Policy
Terms of Use

User Functions

Login