ksh - need to replace a string from file1 to file2 -



ksh - need to replace a string from file1 to file2 -

hi all,

i have 2 files ft2 source , sqll.ksh destination.

my need alter control=raja control=kartik1 , etc others too.

kmariappan $ cat ft2.txt karthik1 karthik2 karthik3 kmariappan $ cat sqll.ksh sqlldr aja/raja123 control=raja log=ssed.log sqlldr aja/raja123 control=raja1 log=ssed.log sqlldr aja/raja123 control=raja2 log=ssed.log expected output sqlldr aja/raja123 control=karthik log=ssed.log sqlldr aja/raja123 control=karthik1 log=ssed.log sqlldr aja/raja123 control=karthik2 log=ssed.log

awk ' nr==fnr {name[nr]=$1; next} {sub(/control=[^[:blank:]]+/, "control=" name[fnr]); print} ' ft2 sqll.ksh

if you're satisfied it's working, add together end of command

> sqll.new && mv sqll.new sqll.ksh

ksh

Comments

Popular posts from this blog

formatting - SAS SQL Datepart function returning odd values -

c++ - Apple Mach-O Linker Error(Duplicate Symbols For Architecture armv7) -

php - Yii 2: Unable to find a class into the extension 'yii2-admin' -