text on one line

Discuss RoboTask here
Post Reply
photoevents
Posts: 51
Joined: Mon Jan 01, 2024 11:21 am
Contact:

text on one line

Post by photoevents »

I have this text file with names seperated by ;
like
first;last;

I use CSV Open Data, Data Loop, convert to text and create file in mode append to write a new file that has the names like this:
first last

But my action creates a file like this:
first
last

How can I keep the two variables on one line?
see the simple script below

Code: Select all

;*****************************
;* RoboTask Task file
;* Do not edit in text editor!
;*****************************
 
[Root]
ActionAfterRun=INTEGER|0
Actions=FOLDER
Automat=INTEGER|-1
CatID=INTEGER|1189457273
Comment=STRINGLIST
ContinueOnError=INTEGER|0
DisableOnError=INTEGER|0
DoNotStopWhenShutdown=INTEGER|0
ExternalName=STRING|"Task334"
Hide=INTEGER|0
ID=INTEGER|-1035998595
LogOnAsUser=INTEGER|1
Name=STRING|"New test task"
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_CSV_OPEN"
Enabled=INTEGER|-1
Name=STRING|"CSV Open Data"
Params=FOLDER

[Actions\Action1\Params]
commentchars=STRING|"#"
delimiter=STRING|"2"
encoding=STRING|"0"
filename=STRING|"S:\photoevents\2025\resources\Deelnemerslijst.csv"
headerline=STRING|"0"
linecount=STRING|"0"
quotechar=STRING|"0"
skipcomments=STRING|"0"
skipempty=STRING|"1"
skipfirst=STRING|"0"
source=STRING|"1"
strictdelimiter=STRING|"1"

[Actions\Action2]
ActionID=STRING|"A_CSV_LOOP"
Enabled=INTEGER|-1
Name=STRING|"CSV Data Loop"
Params=FOLDER

[Actions\Action2\Params]
_rt_variables_produced=STRING|"rownr,rowvalue"
commentchars=STRING|"#"
conditionmode=STRING|"0"
conditionscount=STRING|"0"
delimiter=STRING|"2"
encoding=STRING|"0"
Format=STRING|"0"
headerline=STRING|"0"
linecount=STRING|"0"
linevarname=STRING|"rowvalue"
quotechar=STRING|"0"
rowvarname=STRING|"rownr"
skipcomments=STRING|"0"
skipempty=STRING|"1"
skipfirst=STRING|"0"
source=STRING|"0"
strictdelimiter=STRING|"1"

[Actions\Action3]
ActionID=STRING|"A_CSV_READCELLS"
Enabled=INTEGER|-1
Name=STRING|"CSV Read Cells"
Params=FOLDER

[Actions\Action3\Params]
_rt_variables_produced=STRING|"familienaam,voornaam"
cellcount=STRING|"2"
col0=STRING|"1"
col1=STRING|"2"
commentchars=STRING|"#"
delimiter=STRING|"2"
encoding=STRING|"0"
headerline=STRING|"0"
linecount=STRING|"0"
quotechar=STRING|"0"
row0=STRING|"{rownr}"
row1=STRING|"{rownr}"
skipcomments=STRING|"0"
skipempty=STRING|"1"
skipfirst=STRING|"0"
source=STRING|"0"
strictdelimiter=STRING|"1"
val0=STRING|"voornaam"
val1=STRING|"familienaam"

[Actions\Action4]
ActionID=STRING|"A_TXT_UTF8"
Enabled=INTEGER|-1
Name=STRING|"UTF8 text --> Text"
Params=FOLDER

[Actions\Action4\Params]
_rt_variables_produced=STRING|"voornaam"
kind=STRING|"1"
line00000000=STRING|"{voornaam}"
lines=STRING|"1"
variable=STRING|"voornaam"

[Actions\Action5]
ActionID=STRING|"A_TXT_UTF8"
Enabled=INTEGER|-1
Name=STRING|"UTF8 text --> Text"
Params=FOLDER

[Actions\Action5\Params]
_rt_variables_produced=STRING|"familienaam"
kind=STRING|"1"
line00000000=STRING|"{familienaam}"
lines=STRING|"1"
variable=STRING|"familienaam"

[Actions\Action6]
ActionID=STRING|"A_FILE_TEXTWRITE"
Enabled=INTEGER|-1
Name=STRING|"Create text file S:\photoevents\2025\resources\namenlijst.txt"
Params=FOLDER

[Actions\Action6\Params]
encode=STRING|"1"
fileexists=STRING|"1"
filname=STRING|"S:\photoevents\2025\resources\namenlijst.txt"
line0=STRING|"{voornaam} {familienaam}"
linecount=STRING|"1"
suppress=STRING|"1"
withoutprefix=STRING|"1"

[Actions\Action7]
ActionID=STRING|"A_LOOP_END"
Enabled=INTEGER|-1
Name=STRING|"End Loop"
Oleg
Site Admin
Posts: 3217
Joined: Thu Jan 01, 1970 1:00 am
Contact:

Re: text on one line

Post by Oleg »

You need to cut off EOL symbols from variables voornaam and familienaam
Look at my example below.
Also pay attention:
You can read CSV file as UTF-8 file and remove UTF8 text --> Text steps at all

Code: Select all

;*****************************
;* RoboTask Task file
;* Do not edit in text editor!
;*****************************
 
[Root]
ActionAfterRun=INTEGER|0
Actions=FOLDER
Automat=INTEGER|0
CatID=INTEGER|1189457273
Comment=STRINGLIST
ContinueOnError=INTEGER|0
DisableOnError=INTEGER|0
DoNotStopWhenShutdown=INTEGER|0
ExternalName=STRING|"Task398"
Hide=INTEGER|0
ID=INTEGER|2078034344
LogOnAsUser=INTEGER|1
Name=STRING|"Corrected CSV task"
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
Action10=FOLDER
Action11=FOLDER
Action12=FOLDER
Action2=FOLDER
Action3=FOLDER
Action4=FOLDER
Action5=FOLDER
Action6=FOLDER
Action7=FOLDER
Action8=FOLDER
Action9=FOLDER

[Actions\Action1]
ActionID=STRING|"A_VARIABLES_SET"
Enabled=INTEGER|-1
Name=STRING|"Set variable ""InFile"" with value ""C:\TEMP\csv\InFile.csv"""
Params=FOLDER

[Actions\Action1\Params]
_rt_variables_produced=STRING|"InFile"
expand=STRING|"0"
linecount=STRING|"1"
varname=STRING|"InFile"
varvalue=STRING|"C:\TEMP\csv\InFile.csv"

[Actions\Action10]
ActionID=STRING|"A_STR_TRIM"
Enabled=INTEGER|-1
Name=STRING|"STR Trim"
Params=FOLDER

[Actions\Action10\Params]
_rt_variables_produced=STRING|"familienaam"
custom=STRING|"0"
eol=STRING|"1"
lead=STRING|"1"
source=STRING|"{familienaam}"
spaces=STRING|"1"
tabs=STRING|"1"
trailing=STRING|"1"
variable=STRING|"familienaam"

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

[Actions\Action11\Params]
encode=STRING|"1"
fileexists=STRING|"1"
filname=STRING|"{OutFile}"
line0=STRING|"{voornaam} {familienaam}"
linecount=STRING|"1"
suppress=STRING|"1"
withoutprefix=STRING|"1"

[Actions\Action12]
ActionID=STRING|"A_LOOP_END"
Enabled=INTEGER|-1
Name=STRING|"End Loop"

[Actions\Action2]
ActionID=STRING|"A_VARIABLES_SET"
Enabled=INTEGER|-1
Name=STRING|"Set variable ""OutFile"" with value ""C:\TEMP\csv\OutFile.txt"""
Params=FOLDER

[Actions\Action2\Params]
_rt_variables_produced=STRING|"OutFile"
expand=STRING|"0"
linecount=STRING|"1"
varname=STRING|"OutFile"
varvalue=STRING|"C:\TEMP\csv\OutFile.txt"

[Actions\Action3]
ActionID=STRING|"A_CSV_OPEN"
Enabled=INTEGER|-1
Name=STRING|"CSV Open Data"
Params=FOLDER

[Actions\Action3\Params]
commentchars=STRING|"#"
delimiter=STRING|"2"
encoding=STRING|"0"
filename=STRING|"{InFile}"
headerline=STRING|"0"
linecount=STRING|"0"
quotechar=STRING|"0"
skipcomments=STRING|"0"
skipempty=STRING|"1"
skipfirst=STRING|"0"
source=STRING|"1"
strictdelimiter=STRING|"1"

[Actions\Action4]
ActionID=STRING|"A_FILE_DELETE"
Enabled=INTEGER|-1
Name=STRING|"Delete File"
Params=FOLDER

[Actions\Action4\Params]
Count=STRING|"1"
deletedirs=STRING|"0"
deletereadonly=STRING|"0"
file0=STRING|"{OutFile}"
hidden=STRING|"1"
subdir=STRING|"0"
system=STRING|"1"
ToRecycleBin=STRING|"0"

[Actions\Action5]
ActionID=STRING|"A_CSV_LOOP"
Enabled=INTEGER|-1
Name=STRING|"CSV Data Loop"
Params=FOLDER

[Actions\Action5\Params]
_rt_variables_produced=STRING|"rownr,rowvalue"
commentchars=STRING|"#"
conditionmode=STRING|"0"
conditionscount=STRING|"0"
delimiter=STRING|"2"
encoding=STRING|"0"
Format=STRING|"0"
headerline=STRING|"0"
linecount=STRING|"0"
linevarname=STRING|"rowvalue"
quotechar=STRING|"0"
rowvarname=STRING|"rownr"
skipcomments=STRING|"0"
skipempty=STRING|"1"
skipfirst=STRING|"0"
source=STRING|"0"
strictdelimiter=STRING|"1"

[Actions\Action6]
ActionID=STRING|"A_CSV_READCELLS"
Enabled=INTEGER|-1
Name=STRING|"CSV Read Cells"
Params=FOLDER

[Actions\Action6\Params]
_rt_variables_produced=STRING|"familienaam,voornaam"
cellcount=STRING|"2"
col0=STRING|"1"
col1=STRING|"2"
commentchars=STRING|"#"
delimiter=STRING|"2"
encoding=STRING|"0"
headerline=STRING|"0"
linecount=STRING|"0"
quotechar=STRING|"0"
row0=STRING|"{rownr}"
row1=STRING|"{rownr}"
skipcomments=STRING|"0"
skipempty=STRING|"1"
skipfirst=STRING|"0"
source=STRING|"0"
strictdelimiter=STRING|"1"
val0=STRING|"voornaam"
val1=STRING|"familienaam"

[Actions\Action7]
ActionID=STRING|"A_TXT_UTF8"
Enabled=INTEGER|-1
Name=STRING|"UTF8 text --> Text"
Params=FOLDER

[Actions\Action7\Params]
_rt_variables_produced=STRING|"voornaam"
kind=STRING|"1"
line00000000=STRING|"{voornaam}"
lines=STRING|"1"
variable=STRING|"voornaam"

[Actions\Action8]
ActionID=STRING|"A_TXT_UTF8"
Enabled=INTEGER|-1
Name=STRING|"UTF8 text --> Text"
Params=FOLDER

[Actions\Action8\Params]
_rt_variables_produced=STRING|"familienaam"
kind=STRING|"1"
line00000000=STRING|"{familienaam}"
lines=STRING|"1"
variable=STRING|"familienaam"

[Actions\Action9]
ActionID=STRING|"A_STR_TRIM"
Enabled=INTEGER|-1
Name=STRING|"STR Trim"
Params=FOLDER

[Actions\Action9\Params]
_rt_variables_produced=STRING|"voornaam"
custom=STRING|"0"
eol=STRING|"1"
lead=STRING|"1"
source=STRING|"{voornaam}"
spaces=STRING|"1"
tabs=STRING|"1"
trailing=STRING|"1"
variable=STRING|"voornaam"

Oleg Yershov
photoevents
Posts: 51
Joined: Mon Jan 01, 2024 11:21 am
Contact:

Re: text on one line

Post by photoevents »

Okay, got it, thank you
Post Reply