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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

addition of 1 row

Dear All,
I have an csv file called ABC.txt in which I want to add an header from one csv file called Header.csv.
I am using tsystem component with following code in "use Single Command" .
"/bin/bash tempath='/home/UserTalend/Desktop/CI/ABC.txt' Filepath='/home/UserTalend/Desktop/CI/Header.csv ' for line in $temppath; do cat $Filepath $line>tmp && mv tmp $line done"

I am getting an error:
No such file or directory
tSystem_1_EXIT_VALUE :127.

If I run the same unix code through CMD then I get an custom header in my ABC.txt file. I am not sure where I made mistake.

Do we have any other idea to add custom headers for 1000 files in simple one go.
Please provide your valuable suggestion.

Labels (2)
5 Replies
Anonymous
Not applicable
Author

Any suggestion please...
Anonymous
Not applicable
Author

That is not a single command though. It would probably be easier to write a parameterised script and call that. 
Anonymous
Not applicable
Author

Can you please explain more for your suggestion.

Thanks in advance.

Regards
RSH
Anonymous
Not applicable
Author

If you are wanting to do several things at once with the tSystem component, why not create a bash script that can be called by the tSystem? Call the script with whatever parameters you may need (file locations, etc). That will be seen as one command and you can tailor it to do exactly what you need to the files.
Anonymous
Not applicable
Author

Dear All,
I am using windows remote connection in that I am using Talend 5.6 on linux box.I am having an text file(tfileoutputdelimited) in output with split after every 1000 records. I want to add custom header in all files which already having source table's header.
Example 0683p000009M9p6.pngource oracle data:
A B C
1 2 3
6 2 1

I need output in text file as(comma separator):
ID,NAME,PWD
A,B,C
1,2,3
6,2,1

I used unix command in cmd and it working but same code(mentioned in below email) i use in talend then its not working.
I used linux command in cmd and it working but same code is not working in talend.
Code in CMD as well as in talend tsystem-> "sed -i '1s/^/'ID,NAME,PWD'\n/' ABC*.txt"

Can you please help me out..

Regards
RSH