Code:
$
$ # your input file
$
$ cat f0.in
8273518145,SDP-DM-152281623
9062995078,SDP-DM-152281631
7870856010,SDP-DM-152281650
8445208702,SDP-DM-152281662
8923084825,SDP-DM-152281668
9061161091,SDP-DM-152281712
8401832603,SDP-DM-152281733
8273522929,SDP-DM-152281837
8341646298,SDP-DM-152281851
9062930630,SDP-DM-152281868
$
$
$ # your script
$
$ cat f0.sh
#!/bin/bash
if [ $# -ne 2 ]
then
echo "Error in $0 - Invalid Argument Count"
echo "Syntax: $0 input_file output_file"
# exit
fi
awk -F"," '{print $1 , $2}' $1 |
while read a b
do
output=`cat $2 | grep "CustomCDRInterceptor" | grep "$a" | grep "$b" | cut -d"|" -f6 | awk -F"," '{print $4,",",$28,",",$27,",",$17,",",$12,","$21,",",$11,",",$26,",",$14,",",$6,",",$30,",",$31,",",$19,",",$5,",",$22,",",$10,",",$9,",",$20,",",$15,",",$29,",",substr($32,1,match($32,/\]/)-1),",",$23,",",$18,",",$24,",",$7,",",$13,",",$2,",",$25,",",$16,",",$8,",",$1,",",$3,","}'`
#echo $output
echo $output | perl -F, -lane 's/^\s*[- \w\[]+:(.*?)\s*$/$1/ foreach @F; print join ",", @F'
done
$
$
$ # i'll run your script on your input file
$
$ ./f0.sh f0.in f0.out
cat: f0.out: No such file or directory
cat: f0.out: No such file or directory
cat: f0.out: No such file or directory
cat: f0.out: No such file or directory
cat: f0.out: No such file or directory
cat: f0.out: No such file or directory
cat: f0.out: No such file or directory
cat: f0.out: No such file or directory
cat: f0.out: No such file or directory
cat: f0.out: No such file or directory
$
$ # do we have an output file ?
$
$ cat f0.out
cat: f0.out: No such file or directory
$
$