Six Stars

How to populate a column as blank in outputfile

Hi,

 

I have column called 'description' but I want this column to be populated as blank in the output file. How should I do it..?

1 ACCEPTED SOLUTION

Accepted Solutions
Twelve Stars

Re: How to populate a column as blank in outputfile

@KanT,if you do not give Expression of Out section in tmap,will populate as blank.

 

please find the bleow screenshoot.Untitled.png

Manohar B
6 REPLIES
Moderator

Re: How to populate a column as blank in outputfile

Hello,

You can try to replace your column with"" by using replaceAll(old char, new char) in tMap.

Let us know if it works for you.

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.
Twelve Stars

Re: How to populate a column as blank in outputfile

@KanT,if you do not give Expression of Out section in tmap,will populate as blank.

 

please find the bleow screenshoot.Untitled.png

Manohar B
Six Stars

Re: How to populate a column as blank in outputfile

Hi Manodwhb,

 

One more thing, if I want to set the default value of the certain column to 1. Should I make the change in the input file by defining the default value as "1".

I tried couple of combinations by making it as 1, or "1", change the field type to String. But nothing works.

 

How do I set value to 1..?

 

 

12.png

 

 

Twelve Stars

Re: How to populate a column as blank in outputfile

@KanT,you can use below link to set the default values in tfileinputdelimited.

 

 

https://help.talend.com/reader/mhqCkTBnin7IXmJBUJoocQ/~H7aem4LpI~B45e74SJN1w

 

Manohar B
Six Stars

Re: How to populate a column as blank in outputfile

Thanks for the link. I did look this link before. It talks about setting default values for string. But if u want to default integer values, it doesn't work this way.

Twelve Stars

Re: How to populate a column as blank in outputfile

Otherway you can try in tmap that expression somting like

 

row1.fieldname== null ? 1 : row1.fieldname

Manohar B