Arbeiten mit dem SydroCmd tool

Aus TALSIM Docs
Version vom 18. Juli 2019, 09:25 Uhr von Christina (Diskussion | Beiträge) (Die Seite wurde neu angelegt: „Das Kommandozeilenwerkzeug von Sydro <code>SydroCmd.exe</code> kann als alleinstehendes Werkzeug benutzt werden oder über den Arbeiten mit dem TaskSrv|TaskS…“)
(Unterschied) ← Nächstältere Version | Aktuelle Version (Unterschied) | Nächstjüngere Version → (Unterschied)

Das Kommandozeilenwerkzeug von Sydro SydroCmd.exe kann als alleinstehendes Werkzeug benutzt werden oder über den TaskServer konfiguriert und aufgerufen werden. Es wird im Pre- und Postprocessing sowie im Operationellen Einsatz von Talsim-NG genutzt.

Anwendung des SydroCmd tools

Die Anwendung des SydroCmd tools ist sehr simpel. Es wird über die Kommandozeile aufgerufen zusammen mit dem Schlüssel für den auszuführenden Befehl und den dazugehörenden Argumenten, jeweils getrennt durch ein Leerzeichen:

SydroCmd -command Arg1 Arg2 Arg3 Arg4

SydroCmd Befehle

Extract

Extracts strings from each line within an ASCII file.

Argument Description
Key -extract
1 sourcefile
2 -string or -pos or -split
(-string=search for a string, -pos=select a position, -split=delimits the string)
3 either string or position as a number
4 -endstring or –endlen or -array
5 either a string or the work blank or a position as integer, depending on the previous argument. With -split a comma-separated list of indices is required indicating which items should be saved
6 targetfile


Example1
extracts a string from each line within d:\temp\abc.txt which follows directly after val= and ends at the next blank.
SydroCmd -extract d:\temp\abc.txt -string :val= -endstring blank d:\temp\extract.txt
Example 2
extracts a string from each line within d:\temp\abc.txt starting from position 15 with a length of 25 characters.
SydroCmd -extract d:\temp\abc.txt -pos 15 -endlen 25 d:\temp\extract.txt


Download

Downloads a file with a valid URL to the local memory.

Argument Description
Key -download
1 URL (possibly with spaceholders like {0}
2 Arguments separated by a comma filling the spaceholders in the URL
3 targetfile
Example
Downloads a file from the NOAA data archive. Variables are the year, month, day.
SydroCmd -download http://nomads.ncdc.noaa.gov/modeldata/cfsv2_forecast_mm_9mon/{0}/{0}{1}/{0}{1}{2}/{0}{1}{2}00/flxf.01.{0}{1}{2}00.{3}{4}.avrg.grib.grb2 2016,12,02,2016,12 D:\temp\tmp.grb2

Replace

Replaces all strings with a new string within a file. Is able to handle current date information.


Argument Description
Key -replace
1 sourcefile
2 string to be searched for (see options)
3 Replacement string, string to be inserted (see options)
4 targetfile (if not given, sourcefile will be overwritten)

Options