grep -Fxvf testdata.xls file_GTDA1.xls >file_GTDA.xls
SLS_COUNT=`grep 'GTDA_Dly_Sls' file_GTDA.xls |wc -l`
PMIX_COUNT=`grep 'GTDA_Dly_Pmix' file_GTDA.xls |wc -l`
if [ $SLS_COUNT -gt 0 ]; then
var1=`cat file_GTDA.xls|grep 'GTDA_Dly_Sls_'`
var4="|"
for i in $var1
do
var3=`cut -d "$var4" -f18,19 $i|sort -u`
var2=$var4""$var3
sed -n 's/'"$var2"'//p' $i> ./temp/$i
# sed -e 's/'"$var2"'//p' $i> ./temp/$i
done
echo " GTDA sales done"
fi
if [ $PMIX_COUNT -gt 0 ]; then
var1=`cat file_GTDA.xls|grep 'GTDA_Dly_Pmix_'`
var4="|"
for i in $var1
do
var3=`cut -d "$var4" -f12,13 "$i"|sort -u`
var2=$var4""$var3
sed -n 's/'"$var2"'//p' $i> ./temp/$i
done
echo " GTDA Pmix done"
fi
when i am running above code it is giving me below error:
cut: GTDA_Dly_Sls_SS_136_20130917.20130917205418.psv: No such file or directory
sed: can't read GTDA_Dly_Sls_SS_136_20130917.20130917205418.psv: No such file or directory
GTDA sales done
cut: GTDA_Dly_Pmix_AT_136_20130917.20130917205418.psv: No such file or directory
sed: can't read GTDA_Dly_Pmix_AT_136_20130917.20130917205418.psv: No such file or directory
cut: GTDA_Dly_Pmix_AT_136_20130917.20130917205619.psv: No such file or directory
sed: can't read GTDA_Dly_Pmix_AT_136_20130917.20130917205619.psv: No such file or directory
cut: GTDA_Dly_Pmix_AT_66_20130917.20130917205619.psv: No such file or directory
sed: can't read GTDA_Dly_Pmix_AT_66_20130917.20130917205619.psv: No such file or directory
cut: GTDA_Dly_Pmix_CA_12_20130917.20130917205619.psv: No such file or directory
sed: can't read GTDA_Dly_Pmix_CA_12_20130917.20130917205619.psv: No such file or directory
GTDA Pmix done
i tried this command it is giving below error:
ls -ld GTDA_Dly_Sls_SS_136_20130917.20130917205418.psv /bin/ls: cannot access GTDA_Dly_Sls_SS_136_20130917.20130917205418.psv: No such file or directory
but my path contains .xls file which contains many files in it..
/dm/RMDW_LandingZone/dev/work_area/ABaC_reregister> more file_GTDA.xls
GTDA_Dly_Pmix_AT_136_20130917.20130917205418.psv
GTDA_Dly_Pmix_AT_136_20130917.20130917205619.psv
GTDA_Dly_Pmix_AT_66_20130917.20130917205619.psv
GTDA_Dly_Pmix_CA_12_20130917.20130917205619.psv
GTDA_Dly_Sls_SS_136_20130917.20130917205418.psv
---------- Post updated at 02:45 PM ---------- Previous update was at 02:32 PM ----------
hi,
the problem is the files which i am passing to temp folder after below command ...
var1=`cat file_GTDA.xls|grep 'GTDA_Dly_Sls_'`
var4="|"
for i in $var1
do
var3=`cut -d "$var4" -f18,19 $i|sort -u`
var2=$var4""$var3
sed -n 's/'"$var2"'//p' $i> ./temp/$i
# sed -e 's/'"$var2"'//p' $i> ./temp/$i
done