I think its better to use the unix commands and double quote the col3 and then read the data from the file.
If the file is fixed width, then go for fixed width flat file instead of delimited one.
I have flat file (which is separated by comma) and has the following columns
Code:Col1, col2, col3, col4 ------------------------------------------------ Davan, 100 , #32,mathahalli,Bangalore, 100000 Hari , 200 , #32,marthahalli,Bagalore, 200000
But in 3rd column we have address which is separated again by comma. How can we load the data into target .with the use of only informatica?
I dont want to use any unix script for changing the format of the file. Everything should be handled in informatica.
I think its better to use the unix commands and double quote the col3 and then read the data from the file.
If the file is fixed width, then go for fixed width flat file instead of delimited one.
Run the following awk command:
The variable a indicates the actual columns in the file. n indicates the number of fields in the file because of the delimiter. e is the position of the address field.Code:awk -F',' 'BEGIN {OFS=","} {a=4;n=NF;e=3;h=n-(e-1)-(a-e);s="\""; for(i=e;i<=h+e-1;i++){s=s$i",";$i=""; } ;i=i-1;s=s"\"";$i=s; gsub (/,+/,",",$0);print $0}' filename
Bookmarks