0

I am importing a CSV file to be processed in a transformation. Originally I was using the CSV File Input. I later learned I could not have any null values. So I switched to the Text File Input because it had a Default Column in the Fields Tab that was supposed to set a "Default value in case the field in the text file was not specified (empty)"

enter image description here

However, when I populate the Default column for a Field with a Null value. The field remains null in the Transformation. Any idea what I'm doing wrong.

Kamil Gosciminski
  • 16,547
  • 8
  • 49
  • 72
  • Is the value `null` literally in the CSV? I think is evaluated as `"null"` like the text string. So you need to replace it later. – bolav Feb 04 '16 at 19:59

1 Answers1

1

Tested on version 5.4

The Default option under Fields tab works as expected, so there must be something else you're doing wrong. Hopefully this will lead you in the right direction. Remember please that string literal value "null" is not a NULL value. If this is your case consider replacing those values in second step.

Input file with header column and ; as delimiter:

enter image description here

Here is the results with correctly replaced null values from input file with the specified default value:

Results

And the settings are:

Settings of text file input

Edit

After comment that in version 6.0.1 it is not working for the OP, I'm attaching an image with a different way to approach this problem.

Use If field value is null step to give default values for nulls.

If field value is null approach

Kamil Gosciminski
  • 16,547
  • 8
  • 49
  • 72