Link to home
Start Free TrialLog in
Avatar of amankhan2005
amankhan2005Flag for India

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
ASKER CERTIFIED SOLUTION
Avatar of woolmilkporc
woolmilkporc
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial