2 used awk instead of grep so as to replace only one field instead of matching string. and used IFS cause it was also taking " " as line seperator
source | link

After help from @ClaudioM I found the answer I was looking for.

#!/bin/bash
if [ -z "${3}" ];then
        echo "Usage: <filename> <delimiter> <field_no>"
else
        FILENAME=$(readlink -f $1)FILENAME=$1
        DELIMITER=$2
        FIELD_NO=$3
        TEMP_FILE=/tmp/tempFile
        if [ -f ${TEMP_FILE}$TEMP_FILE ]; then
            rm ${TEMP_FILE}$TEMP_FILE
        fi
        OLDIFS=$IFS; IFS=$'\n'
        for line in $(cat $FILENAME)
        do
                echo $line
                oldValue=`echo $line|cut -d${DELIMITER}d$DELIMITER -f3`f$FIELD_NO`
                echo "Enter the value to replace [$oldValue]"
                read newValue
                echo $line | sedawk "s/;$-F "$DELIMITER" '{oldValue$'$FIELD_NO'="'$newValue'"}/;${newValueprint}/g"' OFS=$DELIMITER >> ${TEMP_FILE}$TEMP_FILE;IFS=$OLDIFS
        done
fi
mv $TEMP_FILE $FILENAME

After help from @ClaudioM I found the answer I was looking for.

#!/bin/bash
if [ -z "${3}" ];then
        echo "Usage: <filename> <delimiter> <field_no>"
else
        FILENAME=$(readlink -f $1)
        DELIMITER=$2
        FIELD_NO=$3
        TEMP_FILE=/tmp/tempFile
        if [ -f ${TEMP_FILE} ]; then
            rm ${TEMP_FILE}
        fi
        for line in $(cat $FILENAME)
        do
                oldValue=`echo $line|cut -d${DELIMITER} -f3`
                echo "Enter the value to replace [$oldValue]"
                read newValue
                echo $line | sed "s/;${oldValue}/;${newValue}/g" >> ${TEMP_FILE}
        done
fi
mv $TEMP_FILE $FILENAME

After help from @ClaudioM I found the answer I was looking for.

#!/bin/bash
if [ -z "${3}" ];then
        echo "Usage: <filename> <delimiter> <field_no>"
else
        FILENAME=$1
        DELIMITER=$2
        FIELD_NO=$3
        TEMP_FILE=/tmp/tempFile
        if [ -f $TEMP_FILE ]; then
            rm $TEMP_FILE
        fi
        OLDIFS=$IFS; IFS=$'\n'
        for line in $(cat $FILENAME)
        do
                echo $line
                oldValue=`echo $line|cut -d$DELIMITER -f$FIELD_NO`
                echo "Enter the value to replace [$oldValue]"
                read newValue
                echo $line | awk -F "$DELIMITER" '{$'$FIELD_NO'="'$newValue'"}{print}' OFS=$DELIMITER >> $TEMP_FILE;IFS=$OLDIFS
        done
fi
mv $TEMP_FILE $FILENAME
1
source | link

After help from @ClaudioM I found the answer I was looking for.

#!/bin/bash
if [ -z "${3}" ];then
        echo "Usage: <filename> <delimiter> <field_no>"
else
        FILENAME=$(readlink -f $1)
        DELIMITER=$2
        FIELD_NO=$3
        TEMP_FILE=/tmp/tempFile
        if [ -f ${TEMP_FILE} ]; then
            rm ${TEMP_FILE}
        fi
        for line in $(cat $FILENAME)
        do
                oldValue=`echo $line|cut -d${DELIMITER} -f3`
                echo "Enter the value to replace [$oldValue]"
                read newValue
                echo $line | sed "s/;${oldValue}/;${newValue}/g" >> ${TEMP_FILE}
        done
fi
mv $TEMP_FILE $FILENAME