I have the problem that I read a string from a Microsoft database that is formatted in HTML and want to insert it into a CSV file. Unfortunately, this sometimes contains a "return character" so that a line break occurs in the CSV file.
Is there a way to filter or replace such characters? I tried using STR REPLACE or STR TRIM, but it didn't work to format it.
Delete/Replace in String HTML Code
Re: Delete/Replace in String HTML Code
Send me an example of such string.
I wanted to recommend the "Str Replace" action.
I wanted to recommend the "Str Replace" action.
Oleg Yershov
Re: Delete/Replace in String HTML Code
I solved it with VBScript:
Code: Select all
RTVar = RoboTaskApp.ExpandText("{BESCHREIBUNGKOMPLETT}")
rtVar = Replace(rtVar, vbCr, "")
rtVar = Replace(rtVar, vbLf, "")
RoboTaskApp.SetUserVariable "BESCHREIBUNGKOMPLETT", rtvar
Re: Delete/Replace in String HTML Code
Good.
You can do this without basic (by using STR replace action)
Look at my example below:
You can do this without basic (by using STR replace action)
Look at my example below:
Code: Select all
;*****************************
;* RoboTask Task file
;* Do not edit in text editor!
;*****************************
[Root]
ActionAfterRun=INTEGER|0
Actions=FOLDER
Automat=INTEGER|-1
CatID=INTEGER|444033236
Comment=STRINGLIST
ContinueOnError=INTEGER|0
DisableOnError=INTEGER|0
DoNotStopWhenShutdown=INTEGER|0
ExternalName=STRING|"Task9"
Hide=INTEGER|0
ID=INTEGER|-1783383291
LogOnAsUser=INTEGER|1
Name=STRING|"remove end-of-line symbols"
OnErrorTaskID=INTEGER|0
Priority=INTEGER|3
RestrictRESTAPIAccess=INTEGER|0
RunOnClose=INTEGER|0
RunOnStartup=INTEGER|0
StepPause=INTEGER|0
ToLog=INTEGER|3
UnicodeFormat=INTEGER|1
WriteGeneralLog=INTEGER|0
[Actions]
Action1=FOLDER
Action2=FOLDER
Action3=FOLDER
Action4=FOLDER
[Actions\Action1]
ActionID=STRING|"A_VARIABLES_SET"
Enabled=INTEGER|-1
Name=STRING|"Set variable ""text"" with value ""First line"""
Params=FOLDER
[Actions\Action1\Params]
_rt_variables_produced=STRING|"text"
expand=STRING|"0"
linecount=STRING|"3"
varname=STRING|"text"
varvalue=STRING|"First line"
varvalue00000001=STRING|"Second line"
varvalue00000002=STRING|"Third line"
[Actions\Action2]
ActionID=STRING|"A_STR_REPLACE"
Enabled=INTEGER|-1
Name=STRING|"STR Replace // remove CR"
Params=FOLDER
[Actions\Action2\Params]
_rt_variables_produced=STRING|"line"
case=STRING|"0"
mode=STRING|"0"
source=STRING|"{text}"
substring=STRING|"{Chr(13)}"
variable=STRING|"line"
[Actions\Action3]
ActionID=STRING|"A_STR_REPLACE"
Enabled=INTEGER|-1
Name=STRING|"STR Replace // replace LF with space"
Params=FOLDER
[Actions\Action3\Params]
_rt_variables_produced=STRING|"line"
case=STRING|"0"
mode=STRING|"0"
replacement=STRING|"{Chr(32)}"
source=STRING|"{line}"
substring=STRING|"{Chr(10)}"
variable=STRING|"line"
[Actions\Action4]
ActionID=STRING|"A_DIALOG_SHOWTEXT"
Enabled=INTEGER|-1
Name=STRING|"Show Text"
Params=FOLDER
[Actions\Action4\Params]
autoclose=STRING|"0"
fromfile=STRING|"1"
line00000000=STRING|"Initial text:"
line00000001=STRING|"{text}"
line00000003=STRING|"Result line:"
line00000004=STRING|"{line}"
linecount=STRING|"5"
timeout=STRING|"10"
Oleg Yershov