Arbeiten mit dem SydroCmd tool: Unterschied zwischen den Versionen

Aus TALSIM Docs
(Diese Seite wurde zum Übersetzen freigegeben)
 
(11 dazwischenliegende Versionen von 2 Benutzern werden nicht angezeigt)
Zeile 1: Zeile 1:
Das Kommandozeilenwerkzeug von Sydro <code>SydroCmd.exe</code> kann als alleinstehendes Werkzeug benutzt werden oder über den [[Arbeiten mit dem TaskSrv|TaskServer]] konfiguriert und aufgerufen werden. Es wird im Pre- und Postprocessing sowie im Operationellen Einsatz von Talsim-NG genutzt.
<languages/>
<translate>


==Anwendung des SydroCmd tools==
<!--T:1-->
Die Anwendung des SydroCmd tools ist sehr simpel.
{{Navigation|vorher=TaskMgr-Verzeichnisstruktur und Dateien|hoch=Hauptseite#Modellerstellung und Anwendung|nachher=Anwendung des SydroCmd-tools}}
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:


<code>SydroCmd -command Arg1 Arg2 Arg3 Arg4</code>
<!--T:2-->
Das Kommandozeilenwerkzeug von Sydro <code>SydroCmd.exe</code> kann als alleinstehendes Werkzeug benutzt werden oder über den [[Special:MyLanguage/Arbeiten mit dem TaskSrv|TaskServer]] konfiguriert und aufgerufen werden. Es wird im Pre- und Postprocessing sowie im Operationellen Einsatz von Talsim-NG genutzt.


==SydroCmd Befehle==
<!--T:3-->
 
*[[Special:MyLanguage/Anwendung des SydroCmd-tools|Anwendung des SydroCmd-tools]]
===Extract===
*[[Special:MyLanguage/SydroCmd-Verzeichnisstruktur und Dateien|SydroCmd-Verzeichnisstruktur und Dateien]]
Extracts strings from each line within an ASCII file.
*[[Special:MyLanguage/SydroCmd Befehle|SydroCmd Befehle]]
 
</translate>
{| class="wikitable" style="width: 50%;"
!style="width: 10%"|Argument
!style="width: 90%"|Description
|-
|Key
|<code>-extract</code>
|-
|1
|sourcefile
|-
|2
|<code>-string</code> or <code>-pos</code> or <code>-split</code> <br />(<code>-string</code>=search for a string, <code>-pos</code>=select a position, <code>-split</code>=delimits the string)
|-
|3
|either string or position as a number
|-
|4
|<code>-endstring</code> or <code>–endlen</code> or <code>-array</code>
|-
|5
|either a string or the work blank or a position as integer, depending on the previous argument. With <code>-split</code> a comma-separated list of indices is required indicating which items should be saved
|-
|6
|targetfile
|}
 
 
;Example1
:extracts a string from each line within <code>d:\temp\abc.txt</code> which follows directly after <code>val=</code> and ends at the next blank.
:<code>SydroCmd -extract d:\temp\abc.txt -string :val= -endstring blank d:\temp\extract.txt</code>
 
;Example 2
: extracts a string from each line within d:\temp\abc.txt starting from position 15 with a length of 25 characters.
:<code>SydroCmd -extract d:\temp\abc.txt -pos 15 -endlen 25 d:\temp\extract.txt</code>
 
 
===Download===
Downloads a file with a valid URL to the local memory.
 
{| class="wikitable" style="width: 50%;"
!style="width: 10%"|Argument
!style="width: 90%"|Description
|-
|Key
|<code>-download</code>
|-
|1
|URL (possibly with spaceholders like <code>{0}</code>
|-
|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.
:<code>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 </code>
 
===Replace===
Replaces all strings with a new string within a file. Is able to handle current date information.
 
{| class="wikitable" style="width: 50%;"
!style="width: 10%"|Argument
!style="width: 90%"|Description
|-
|Key
|<code>-replace</code>
|-
|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====
;2. Argument
: String to be searched for that will be replaced
: Format= <code>[KEYWORD|Valid Formatstring|Valid Number,DateInterval} </code>
::<code>KEYWORD = CURRENTDATE</code>
::<code>Valid Formatstring</code> = possible is <code>yyy</code>, <code>MM</code>, <code>dd</code>, <code>mm</code>
::<code>Valid Number</code>= <code>0, +2, -5</code> or any other integer (adds/subtracts the number of years, months, days, hours, minutes as given with the number)
::<code>DateIntervall</code>= <code>y, M, d, h, m</code> (is used to add the <code>valid number</code> to the date)
:Example: <code>{CURRENTDATE|dd|+1,d}</code> with a date 30/12/2017 results in 31
 
;3. Argument
: ordinary string or in combination with <code>CURRENTDATE</code> a date in the format <code>yyyyMMDDhhmm</code> or the keyword <code>Now</code>

Aktuelle Version vom 23. September 2020, 13:01 Uhr

Sprachen:

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.