ABC|DFE
HYK|YUI
is the contents in file.
I am using the for loop for
for value_list in `cat ./file` ;
do
echo $value_list
cat use_firstvalue > second_value
done
I have to split the based on '|' and it should be used as a varaible in the cat command. How to do that. Please help me out
while IFS='|' && read one two
do
cat $one > $two
done
try with this...
while read line
do
campo1=$(echo $line |cut -d"|" -f1)
campo2=$(echo $line |cut -d"|" -f2)
echo $campo1 --- $campo2
done < FILE_IN
panyam
4
Something like this:
awk -F"|" '{ print "cat "$1 "> "$2 }' input_file | sh