Navigatrix.net - A Voyager's Companion http://navigatrix.net/ |
|
Weather fax with meaningful file names http://navigatrix.net/viewtopic.php?f=10&t=554 |
Page 1 of 1 |
Author: | Markus [ 07 Nov 2013, 06:01 ] |
Post subject: | Weather fax with meaningful file names |
Another one for lazy folks like me... I use Airmail + Pactor/SSB to receive weather fax underway. Works nicely but I find it very cumbersome to navigate through the fax files once they're received. Airmail simply names them with a utc time stamp based on the start of the transmnission (because that's all the information it has) - not an intuitive format to go back to and retrieve a specific fax. Of course I could save each received file under a meaningful name but I'm lazy... Attached is a little Perl script that will copy received fax files from Airmail's "Faxfiles" directory into a directory of my choice and rename them based on some simple rules that are defined at the beginning of the script. I simply take a time interval and say for example "if a fax was received (i.e. start of transmission as indicated by the file name) between 0159 and 0213 utc copy it as 'VMC_AUS_MSLP_36.tif' (36hr forecast for Australia from station VMC) into the directory that I specify as a command line argument to the script. Attachment: The format of these rules (lines 20-61 in the attached file) is simply Code: ["utc_start_time", "utc_end_time", "target_file_name_without_extension"] or Code: ["0159", "0213", "VMC_AUS_MSLP_36"] for the example above. The rules currently listed in the script are for faxes I possibly might receive while underway from New Caledonia to Australia. You can easily substitute your own schedule and faxes. To use the script, simply save the attached ZIP file and extract the shell script into ~/bin ('~' being your home directory - in my case /home/markus/). Then press [ctrl]+[alt]+[T] to open a terminal and make the script executable by typing Code: chmod +x bin/wfcp [enter] Whenever you have one or a bunch of faxes received, simply open a terminal as above and type Code: wfcp <directory to which the faxes are to be copied> [enter] without the '<>' around the directory argument. If the directory does not exist it will be created. If you call the script without any directory argument it will copy the files into the current directory. A few comments:
|
Page 1 of 1 | All times are UTC - 5 hours |
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group http://www.phpbb.com/ |