amankhan2005
asked on
Shell script awk command
Hi,
I am tryin to transfer the data from list20.prn file to output.txt but somehow its returnin 0 bytes..null file...
please advise.
echo "Filter out non dialer processed A/R - Start"
awk 'BEGIN{FS="\",\"";OFS="|"} {$1=$1; print $0}' list20.prn > output.txt
rm -f out.txt
cat output.txt | while read LINE
do
record=`echo $LINE`
tenth=`echo $record | cut -f10 -d"|"`
if [ "$tenth" != "" ]
then
echo $LINE >> out.txt
fi
done
awk 'BEGIN{FS="|";OFS="\",\""} {$1=$1; print $0}' out.txt > output.txt
mv output.txt list20.prn
echo "Filter out - End"
Thanks
Aman
list20.prn
I am tryin to transfer the data from list20.prn file to output.txt but somehow its returnin 0 bytes..null file...
please advise.
echo "Filter out non dialer processed A/R - Start"
awk 'BEGIN{FS="\",\"";OFS="|"}
rm -f out.txt
cat output.txt | while read LINE
do
record=`echo $LINE`
tenth=`echo $record | cut -f10 -d"|"`
if [ "$tenth" != "" ]
then
echo $LINE >> out.txt
fi
done
awk 'BEGIN{FS="|";OFS="\",\""}
mv output.txt list20.prn
echo "Filter out - End"
Thanks
Aman
list20.prn
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.