Six Stars

Remove header white space delimited file

Hello all,

 

I have a csv file with headers such as "emp id", "location address" and so on. I need a way to remove these whiter spaces so that I can run the job through tMap. I am pretty new to Talend there is no one here who can help.

 

Also, the file name will continuously change with a timestamp appended to it.

 

Thanks

Tags (1)
1 ACCEPTED SOLUTION

Accepted Solutions
Twelve Stars TRF
Twelve Stars

Re: Remove header white space delimited file

Set the header field to 1 in the basic settings tab for tFileInputDelimited component


TRF
15 REPLIES
Twelve Stars TRF
Twelve Stars

Re: Remove header white space delimited file

Do you plan to have dynamic schema?

Else, you don't have to worry about the fileds name in the header.

Just ignore the header where reading the file.

For the 2nd point, if you don't know the filename when the job starts, you need to use tFileList with a filemask to get the desired file (I suggest you to rename or move the file when the job finishes).


TRF
Six Stars

Re: Remove header white space delimited file

It will not be dynamic. How do I go about ignoring the included first-row header?

Twelve Stars TRF
Twelve Stars

Re: Remove header white space delimited file

Set the header field to 1 in the basic settings tab for tFileInputDelimited component


TRF
Six Stars

Re: Remove header white space delimited file

When I did that, tMap was erroring.

Twelve Stars TRF
Twelve Stars

Re: Remove header white space delimited file

share your job + tMap configuration + error


TRF
Six Stars

Re: Remove header white space delimited file

It is a simple tFileInputDelimited->tMap->tFileOutputDelimited where I am mixing around the columns.

Twelve Stars TRF
Twelve Stars

Re: Remove header white space delimited file

Share the pictures else I can't help you anymore


TRF
Six Stars

Re: Remove header white space delimited file

Oaky. I will have to do this after my morning 2 meetings. I have to break these out of something bigger and do some renaming prior to posting. There is too much confidential info being displayed currently.

Moderator

Re: Remove header white space delimited file

Hello,

Elaborating your case with an example with input and expected output values will be preferred.

Feel free to let us know if there is any problem for you to upload your job setting screenshots into forum.

Best regards

Sabrina

--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
Six Stars

Re: Remove header white space delimited file

Well, I am not sure why, but this morning, things seem to be working as described.

 

Steve

Twelve Stars TRF
Twelve Stars

Re: Remove header white space delimited file

Great! Feel free to come back in case of new troubles.


TRF
Six Stars

Re: Remove header white space delimited file

Before I start a new topic, is there any information already in existence about adding white space to a header on output?
Twelve Stars TRF
Twelve Stars

Re: Remove header white space delimited file

Hi,

I suppose you want to retrieve your original header when writting to the output file.

If so, the simplest is to get just the heading line when the job starts (tFileInputDelimited with Header = 0 and Limit = 1), then reuse this record to initialize the output file (tFileOutputDelimited with Includ Header unchecked).

Following records will be written to the same output using an other tFileOutputDelimited with Append option checked.

Is that what you're looking for?


TRF
Moderator

Re: Remove header white space delimited file

Hello,

Can we consider this topic as resolved?

Best regards

Sabrina

--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
Six Stars

Re: Remove header white space delimited file

xdshi wrote:

Hello,


xdshi wrote:

Hello,

Can we consider this topic as resolved?

Best regards

Sabrina






I did set this post as solved yesterday. Thanks for asking/following up.