Welcome to iraf.net Sunday, May 12 2024 @ 06:48 PM GMT


 Forum Index > Help Desk > Applications New Topic Post Reply
 Writing to file from a procedure script
   
Gaba_p
 03/12/2009 04:48PM (Read 1992 times)  
++++-
Regular Member

Status: offline


Registered: 10/10/2008
Posts: 104
I need a way to automatically (i.e. from a script) create a file and write the following text into it:char : text1 text2 text3
char2 : text4 text5 text6something along those lines (it's the 'imsets' file from 'mknobsfile'). Can this be done with a script or do I have to do it manually?

 
Profile Email Website
 Quote
fitz
 03/12/2009 04:48PM  
AAAAA
Admin

Status: offline


Registered: 09/30/2005
Posts: 4040
Use a print statement and redirect it to a file, e.g.[code:1:0b6acae616]
print ("char : text1 text2 text3", > "imsets")
print ("char2 : text4 text5 text6", >> "imsets")
[/code:1:0b6acae616]Note the filename 'imsets' is quoted as a literal string, the >> operator is used to append a file.-Mike

 
Profile Email
 Quote
Gaba_p
 03/12/2009 04:48PM  
++++-
Regular Member

Status: offline


Registered: 10/10/2008
Posts: 104
Thanks Mike. One more question if you don't mind. This is a transcript from the 'mkconfig' help:transform
The source of the transformation equations definition. [b:357914ef89]Transform[/b:357914ef89] may be the name of one of the supported standard star catalogs maintained in the directory "photcal$catalogs/", the standard input "STDIN", or a file created by the the user containing the transformation equations definition. [color=red:357914ef89][b:357914ef89]Transform[/b:357914ef89] is not prompted for if [b:357914ef89]template[/b:357914ef89] is "".[/color:357914ef89]template = ""
The name of an existing configuration file that can be used as a template for the new configuration file. [color=red:357914ef89]If [b:357914ef89]template[/b:357914ef89] is the null string "", then MKCONFIG prompts the user for[/color:357914ef89] the source of the standard star catalog and observations file format descriptions [b:357914ef89]catalog[/b:357914ef89] and [b:357914ef89]observations[/b:357914ef89], [color=red:357914ef89]and the source of the transformation equation definitions [b:357914ef89]transform[/b:357914ef89].[/color:357914ef89] If [b:357914ef89]template[/b:357914ef89] exists, MKCONFIG copies [b:357914ef89]template[/b:357914ef89] into [b:357914ef89]config[/b:357914ef89] and enters the editor if [b:357914ef89]edit[/b:357914ef89] is "yes".So transform is or is not prompted if template is ""?

 
Profile Email Website
 Quote
fitz
 03/12/2009 04:48PM  
AAAAA
Admin

Status: offline


Registered: 09/30/2005
Posts: 4040
According to the source code, if template="" then you will still see a prompt for the 'transform' parameter, but the transform param is allowed to still be a null string.-Mike

 
Profile Email
 Quote
   
Content generated in: 0.14 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