I have a bash script which will remove all the Non Ascii character from the file. But i wanted to remove the string after the non Ascii character in all the columns. Below is the script,
> #!/bin/bash SCRIPT_PATH=/trmout/TRMOUTPUT_PROD BKP_PATH=/appinfprd/bi/infogix/Temp_Files/SUPPLY_CHAIN File_Name=WB ######################################################################## ##Deleting the precessed files #### ######################################################################## cd $BKP_PATH rm *.* ######################################################################### ### removing the non ascii char from all Supply chain files ####### ######################################################################### for i in $SCRIPT_PATH/$File_Name*.txt do cp $i $BKP_PATH ########################################################################## ##Replacing the NON ASCII Char from Supply Chain files and saving it.#### ########################################################################## cat $i >> $i.bkp sed -i 's/[\d128-\d255]//g' $i.bkp mv $i.bkp $i done ############################################################################################# ##Creating a sample file which will be having the file name which has NON ASCII Char in it.## ############################################################################################# cd $SCRIPT_PATH grep -vlP '^[\0-\x7f]*$' WB*.txt >Supply_chain_Non_Ascii_List_File.txt ~ ~