Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
ThomasLetellier
Contributor
Contributor

Using sed in tSystem component

Hello,

I'm trying to use the sed command in a tSystem component but I got some troubles...

Here is the command I'm using in the component :

"sudo sed -i 1s/^\\xEF\\xBB\\xBF//"  + ((String)globalMap.get("tFileList_3_CURRENT_FILEPATH"))

When I print it I got the good result (this is the resutl of a System.out.println():

sudo sed -i 1s/^\xEF\xBB\xBF// myFile.txt

The sed command seem's correct and is working fine when using manually in linux, but when I try to use it in Talend I got this error:

sed: -e expression #1, char 19: unknown option to `s'

At first I was using single quotes like this:

"sudo sed -i '1s/^\\xEF\\xBB\\xBF//'"  

but it did not work, I also tried to escape thoses single quotes... same result.

Can somebody tells me how to write correctly this command on the tSystem component ?

Thanks for your help,

Thomas

Labels (2)
1 Reply
manodwhb
Champion II
Champion II

@thomas letellier​ , you no need to use single quote escpe only for double quote you need ot use.

 

Thanks,

Manohar