Problem in cut or paste

Hello,

I have some problem in cut or paste command for my text data.

Input1.txt :

I use cut command :

 cut -d ' ' -f1 Input1.txt > result.txt 

result.txt :

Then, I use paste command to merge result.txt.

 paste -d ' ' result.txt Input1.txt > output.txt 

output.txt showed :

I use cut command again to get data that I want :

 cut -d ' ' -f1,2,5 output.txt > Final.txt 

Final.txt showed :

However, Final.txt have something like question mark symbol (???) after Sam number which I can not see this symbol but some program can detect. I do not know what's happen because I use dos2unix in my dataset.

Could you please suggest me?
Thank you in advance.

You can use awk command to get the desired output.. regarding ??? not sure what inbtw process happening in your script..

 
awk '{print $1" "$1" "$4}'  Input1.txt
1 Like