Rem --- eWON start section: Cyclic Section eWON_cyclic_section: Rem --- eWON user (start) Rem --- eWON user (end) End Rem --- eWON end section: Cyclic Section Rem --- eWON start section: Init Section eWON_init_section: Rem --- eWON user (start) PRINT "File processing..." OPEN "exp:$dtTL$ftT" FOR TEXT INPUT AS 1 OPEN "file:/usr/fileToSend.txt" FOR BINARY OUTPUT AS 2 TitleLine% = 0 ReadNext: IF EOF 1 THEN GOTO ReadDone Line$ = GET 1 print Line$ //Add line to usr file //Print @SplitString$(Line$,2,";",0) + ";" + "m3/s" GOTO ReadNext ReadDone: CLOSE 1 CLOSE 2 PRINT "File processed" Function ReplaceStr$($InputString$, $SearchString$, $ReplaceByString$) $Loop: $posstr% = INSTR 1, $InputString$, $SearchString$ IF $posstr% = 0 THEN GOTO $endloop $SearchStringEndPos% = $posstr% + LEN $SearchString$ $LenInputString% = LEN $InputString$ IF $SearchStringEndPos% > $LenInputString% THEN //SearchString is at the end of the InputString $ReplaceStr$ = $InputString$(1 To $posstr%-1) + $ReplaceByString$ ELSE $ReplaceStr$ = $InputString$(1 To $posstr%-1) + $ReplaceByString$ + $InputString$($SearchStringEndPos% To $LenInputString%) ENDIF $InputString$ = $ReplaceStr$ GOTO $Loop $endloop: EndFn //Split string function to split my CSV lines Function SplitString$ ($StringToParse$,$Pos%, $char$, $RemoveQuotes%) $e% = 1 $loopnbr% = 0 $NextItem: $f% = INSTR $e% , $StringToParse$ , $char$ //LAST ELEMENT IF $f% = 0 THEN $B$ = $StringToParse$( $e% TO LEN $StringToParse$) GOTO $EndOfLine ENDIF $loopnbr% = $loopnbr% + 1 $B$ = $StringToParse$( $e% TO $f%-1) IF $Pos% = $loopnbr% THEN GOTO $EndOfLine $e% = $f% + 1 //REM Init for next loop/line GOTO $NextItem $EndOfLine: IF ($RemoveQuotes% = 0) THEN $SplitString$ = $B$ ELSE $SplitString$ = $B$(2 TO LEN $B$-1) EndFn Rem --- eWON user (end) End Rem --- eWON end section: Init Section