Hi ,
I am having a ZIP file containing an .xlsx file . Now i wanted to replace "GJ" to blank in the .xlsx file .
I tried using the below code but not working , Please guide :
#!/bin/bash
log="/home/srikant/scripts/replacescriptFHO.log"
date > $log
echo "" >> $log
echo initiating for FHO >> $log
#dfolder="$(date +%d%m%Y --date='-1 day')"
dfolder="$(date +%d%m%Y)"
cd /fs/BHARTI_GUJARAT/TXN/FHO/
echo inside directory- `pwd` >> $log
newAddress=""
oldAddress="GJ"
for fname in file1.zip
do
zipgrep -q $oldAddress $fname;
echo hi 1 >> $log
if [ $? -eq 0 ]; then
echo hi 2 >> $log
filename="${fname%.*}"
echo $filename >> $log
unzip -qp $fname | sed -e 's#'$oldAddress'#'$newAddress'#g' FE_REPORT*
zip $filename.zip $filename
fi
done
echo FHO done >> $log
echo ------------------------------------------------ >> $log