Four Stars

TfileOutputDelimited issue

Hello,

How do i modify the output of my delimited file (csv) to be in a particular sequence.(i.e be in the format/sequence required by the third party system for upload). The output file is currently separated by ";" (semi colon). I want to include a static value(prefix) in all the rows and also do not want all of them to be separated by semi colon. 

How do i go about this modification to generate my required output?

 

Kindly assist.

 

Thanks 

1 ACCEPTED SOLUTION

Accepted Solutions
Ten Stars

Re: TfileOutputDelimited issue

What you're describing isn't supported "out of the box" in Talend. You'll have to combine the data in the last column yourself. The best way to do that depends on what your incoming data looks like.

If the data is already together on one row, you'll want to combine the appropriate columns together, inserting your own delimiter (space) between the values.

If the individual values are on different rows, e.g.:
User;Subject;Ferguson1
User;Subject;Mark1

...you can use an aggregate component with the List function to roll up the rows. The advanced settings tab of tAggregateRow lets you choose the delimiter for the List column.

 

Update after seeing your schema:
Alter your tMap output schema to have only three columns.  Make the third column's expression:
row1.Firstname + " " + row1.Lastname

11 REPLIES
Thirteen Stars TRF
Thirteen Stars

Re: TfileOutputDelimited issue

Hi,

Add a field called "Prefix" to your schema and set its values from a tMap ou tJavaRow.

For the 2nd point, change the tFileOutputDelimited "Field Separator" to an empty string ("").

Should be enough.


TRF
Four Stars

Re: TfileOutputDelimited issue

Hi TRF,

Thank you for your response.

i was able to go ahead with the first one. but for the second one, this is my desired output file 

Subject;joe1;Doe1 Joe1 . 

Between Doe1 and Joe1, i do not want to have the semi colon (";") separator.

How do i configure the output to make the file look like that?

Thirteen Stars TRF
Thirteen Stars

Re: TfileOutputDelimited issue

So it seems you want to marge 2 separated fields from your input.

Use a tMap for that.


TRF
Four Stars

Re: TfileOutputDelimited issue

No, i just want to use two different separators for the generated output file.

";" and " "  an example is this: Subject;joe1;Doe1 Joe1.

currently, it is been separated by only ";"

How do i go about that?

Eleven Stars

Re: TfileOutputDelimited issue

@daescada since you can sepecify the multiple delimiters output file ,as shown below.Untitled.png

Manohar B
Thirteen Stars TRF
Thirteen Stars

Re: TfileOutputDelimited issue

Hi,

You've shared the expected output but not the input.

Give a complete example to receive the appropriate answer to your case.


TRF
Four Stars

Re: TfileOutputDelimited issue

I have an application that i want to upload the data(users) into which requires it to be in this format 

User;Subject;Ferguson1 Mark1 . Please take note of the 'space' between Ferguson1 and Mark1.

This means that it requires two different separators in a single row. (i.e)  ";" and " ".

so the question is, how do i configure the output text to have those two separators in one row.

 

Thanks.

 

Thirteen Stars TRF
Thirteen Stars

Re: TfileOutputDelimited issue

Once again, share your input schema.


TRF
Four Stars

Re: TfileOutputDelimited issue

see attached 

Ten Stars

Re: TfileOutputDelimited issue

What you're describing isn't supported "out of the box" in Talend. You'll have to combine the data in the last column yourself. The best way to do that depends on what your incoming data looks like.

If the data is already together on one row, you'll want to combine the appropriate columns together, inserting your own delimiter (space) between the values.

If the individual values are on different rows, e.g.:
User;Subject;Ferguson1
User;Subject;Mark1

...you can use an aggregate component with the List function to roll up the rows. The advanced settings tab of tAggregateRow lets you choose the delimiter for the List column.

 

Update after seeing your schema:
Alter your tMap output schema to have only three columns.  Make the third column's expression:
row1.Firstname + " " + row1.Lastname

Four Stars

Re: TfileOutputDelimited issue

Thank you