appending two string is not working

Dear Memebers

appending string is not working in loop
outside of loop itw working fine, but when i put in loop its not working.
please look into this code and suggest me how to do this.

supplierCode.txt
---------------
UGEN
SLAND
CEL

here is my script
-------------------

#!/bin/bash
SuppFile=/home/krishnaveni/scripts/supplierCode.txt
file1=log
filename=$file1".txt"
#echo $filename # its working fine
exec 0<$SuppFile
while read LINE
do
echo $LINE
suppProfileName=$LINE"_sftp.profile"
echo $suppProfileName

done

----------------------
Here output is
UGEN
_sftp.profile
SLAND
_sftp.profile
CEL
_sftp.profile

-----------------
but i want output like

UGEN_sftp.profile
SLNAD_sftp.profile
CEL_sftp.profile

Please help me on this.

thanks
krishna.

try like this

filename=${file1}".txt"
suppProfileName=${LINE}"_sftp.profile"

Its not working
still output is like this

UGEN
_sftp.profile
SLAND
_sftp.profile
CEL
_sftp.profile

inside of this loop is not working.

Check it like this:

while read LINE
do
suppProfileName=`echo $LINE"_sftp.profile"`
echo $suppProfileName

done

i dont know why its not working
i tried with commands which you provided me
still its giving output

_sftp.profile
_sftp.profile
_sftp.profile

i tried with
suppProfileName=`echo $LINE"_sftp.profile"`
echo $suppProfileName
and
suppProfileName=`echo ${LINE}"_sftp.profile"`
echo $suppProfileName
no use what to do now, can i know is there any problem with my script.

hi krishna,

can u send the output of following command.

cat -v supplierCode.txt

May be bcoz some non-printable characters at the end ( Just guessing )

Thanks
Penchal

Try

suppProfileName=${LINE}_sftp.profile

Hi Penchal

this is the output of cat -v supplierCode.txt
UGEN^M
SLAND^M
CEL^M

Can you tell me what to do now please.

Thanks
Krishna.

remove those ^M (ctrl + M ) symbols at the end and try

i.e when u do cat -v supplierCode.txt

output must be

UGEN
SLAND
CEL

Thanks
Penchal

Hi,

Can you tell me how to remove hidden values
When i open this txt file i couldnt see it directly
is there any command to remove hidden characters
Please let me know.

If you have unix2dos or a similar command, you can use that. In the absence of any canned command, use the following sequence.

tr -d '\015' <supplierCode.txt >temp
mv temp supplierCode.txt

If your tr doesn't understand the octal character code \015, consult its manual page, or search these forums.

Its working now
thankyou so much guys