Create Text File while Suppressing Trailing End-of-Line

Discuss RoboTask here
Post Reply
OldGeek
Posts: 69
Joined: Thu Jun 01, 2023 2:50 pm
Location: Upstate NY

Create Text File while Suppressing Trailing End-of-Line

Post by OldGeek »

I can't seem to write to a text file suppressing the EOL. I write one time and there is not EOL, which I wanted. But when I write two times this first write has a EOF and the second doesn't. I want to keep appending text to one line
Windows 11 Pro, RoboTask v10.6
Oleg
Site Admin
Posts: 3307
Joined: Thu Jan 01, 1970 1:00 am
Contact:

Re: Create Text File while Suppressing Trailing End-of-Line

Post by Oleg »

Do you want the task like this?

Code: Select all

;*****************************
;* RoboTask Task file
;* Do not edit in text editor!
;*****************************
 
[Root]
ActionAfterRun=INTEGER|0
Actions=FOLDER
Automat=INTEGER|-1
CatID=INTEGER|307868550
Comment=STRINGLIST
ContinueOnError=INTEGER|0
DisableOnError=INTEGER|0
DoNotStopWhenShutdown=INTEGER|0
ExternalName=STRING|"Task1466"
Hide=INTEGER|0
ID=INTEGER|1589136272
LogOnAsUser=INTEGER|1
Name=STRING|"Write as single line"
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
Action5=FOLDER
Action6=FOLDER
Action7=FOLDER

[Actions\Action1]
ActionID=STRING|"A_VARIABLES_SET"
Enabled=INTEGER|-1
Name=STRING|"Set variable ""_filename"" with value ""C:\temp\testfile.txt"""
Params=FOLDER

[Actions\Action1\Params]
_rt_variables_produced=STRING|"_filename"
expand=STRING|"0"
linecount=STRING|"1"
varname=STRING|"_filename"
varvalue=STRING|"C:\temp\testfile.txt"

[Actions\Action2]
ActionID=STRING|"A_LOOP_WHILE"
Enabled=INTEGER|-1
Name=STRING|"While loop"
Params=FOLDER

[Actions\Action2\Params]
case=STRING|"0"
connection=STRING|"0"
count=STRING|"1"
operator=STRING|"0"
type=STRING|"3"
value1=STRING|"true"

[Actions\Action3]
ActionID=STRING|"A_DIALOG_INPUTBOX"
Enabled=INTEGER|-1
Name=STRING|"Input Box"
Params=FOLDER

[Actions\Action3\Params]
_rt_variables_produced=STRING|"_InputString"
password=STRING|"0"
prompt=STRING|"enter some string (Cancel to stop)"
stopifcancel=STRING|"1"
variable=STRING|"_InputString"

[Actions\Action4]
ActionID=STRING|"A_VARIABLES_SET"
Enabled=INTEGER|-1
Name=STRING|"Set variable ""_txt"" with value ""{TextFile({_filename})} {_InputString}"""
Params=FOLDER

[Actions\Action4\Params]
_rt_variables_produced=STRING|"_txt"
expand=STRING|"0"
linecount=STRING|"1"
varname=STRING|"_txt"
varvalue=STRING|"{TextFile({_filename})} {_InputString}"

[Actions\Action5]
ActionID=STRING|"A_FILE_TEXTWRITE"
Enabled=INTEGER|-1
Name=STRING|"Create text file {_filename}"
Params=FOLDER

[Actions\Action5\Params]
encode=STRING|"0"
fileexists=STRING|"0"
filname=STRING|"{_filename}"
line0=STRING|"{_txt}"
linecount=STRING|"1"
suppress=STRING|"1"
withoutprefix=STRING|"1"

[Actions\Action6]
ActionID=STRING|"A_DIALOG_SHOWTEXT"
Enabled=INTEGER|-1
Name=STRING|"Show Text"
Params=FOLDER

[Actions\Action6\Params]
autoclose=STRING|"0"
filename=STRING|"{_filename}"
fromfile=STRING|"0"
linecount=STRING|"0"
timeout=STRING|"10"
title=STRING|"Your text file"

[Actions\Action7]
ActionID=STRING|"A_LOOP_END"
Enabled=INTEGER|-1
Name=STRING|"End Loop"
Oleg Yershov
Post Reply