Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
I have a requirement,In my table I want to replace \n character with null() from all column.
I can use if condition
if(Col1='\n',null(),Col1) as Col1
But in my table there are above 100 coumn. So is there any alternative let me know..
If you're loading data from text files or excel files you can use the NullInterpret variable. If you add this line at the beginning of your load script then all \n values will be replaced with nulls:
set NullInterpret='\n';
Hi Sumita,
It is better to replace manually by using the If, instead of doing dynamically.
Regards,
Jagan.
Hi ,
In my case I am fetching the data from text file and manually is not possible because there are several column.
And then i have to use the data for further calculation.
Hi,
You have to use this
if(Col1='\n',null(),Col1) as Col1
for all the columns. I think this is the best option when comparing to do this dynamically, it needs lot of scripting and it leads to performance issues.
Hope this helps you.
Regards,
Jagan.
Hi,
Yes i was initially using that but as i mentioned that in my table there are more than 100 column, in which it is not possible and exactly it will degrade the performance.
Thatsy I am looking for alternative solution.(like loop which read my column name and apply that condition. )
Because \n is coming in approx all column.
Sumita,
please provide an example we can work with (example.qvw or Excel).
Thank you!
Rainer
If you're loading data from text files or excel files you can use the NullInterpret variable. If you add this line at the beginning of your load script then all \n values will be replaced with nulls:
set NullInterpret='\n';
Thanku Gysbert.
It is working fine.