I have a data which looks like this
cat 1.txt
abc def ghi
jkl lmn opq
rst uvw xyz
i want to use its contents in another command :
foreach c (`cat 1.txt | awk '{print $1}'`)
cat $c/$1 | sed "s,patter1,pattern2,g" > ! $c/$2
end
where $c=abc , $1 =def , $2 = ghi in first case, then $c=jkl , $1 =lmn , $2 = opq in second case and so on till end of 1.txt
Can someone suggest, how can i do it?
I have tried below :
foreach c (`awk '{print $1}' 1.txt`)
foreach d (`awk '{print $2}' 1.txt`)
foreach e ( `awk '{print $3}' 1.txt` )
echo $c $d $e
end
end
end