Welcome to iraf.net Sunday, May 12 2024 @ 06:48 PM GMT
Gaba_p |
03/12/2009 04:48PM (Read 1992 times)
|
|
|
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?
|
|
|
|
fitz |
03/12/2009 04:48PM
|
|
|
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
|
|
|
|
Gaba_p |
03/12/2009 04:48PM
|
|
|
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 ""?
|
|
|
|
fitz |
03/12/2009 04:48PM
|
|
|
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
|
|
|
|
| |
|
Content generated in: 0.14 seconds |
|