Good afternoon:
im working wih 2 files to find differences and use the cmp command
cmp file1 file2
file1 file2 are are diifferent char 302 line1
i found what the difference is with the sed command and that is the file1 at the end of every line has a (,) (comma) character.
i.e
sed -n l file1|head -5
,1790365,1,F,1,01,00,20121205,23305300,17.00,0000001700,03214534032,0\
3187170198,I,,0,,,N,I,20121207 001649,EDFN,,,0,I,STD,COMCE,BSC,COMBOG\
EG,TAND,27,0404,MOB-315,ENT,ENT-MOB,MM01,Telefonos de BSC,N,0,T_D,1,1\
.00,60.00,17.00,MINRED,1,COMCE,TO,PCO,0.000000,0.000000,MINUTO,1.00,1\
,0.000000,0.00,0.00,,0.00,\r$
sed -n l file2|head -5
1790365,1,F,1,01,00,20121205,23305300,17.00,0000001700,03214534032,0\
3187170198,I,,0,,,N,I,20121207 001649,EDFN,,,0,I,STD,COMCE,BSC,COMBOG\
EG,TAND,27,0404,MOB-315,ENT,ENT-MOB,MM01,Telefonos de BSC,N,0,T_D,1,1\
.00,60.00,17.00,MINRED,1,COMCE,TO,PCO,0.000000,0.000000,MINUTO,1.00,1\
,0.000000,0.00,0.00,,0.00\r$
I want to remove the last character (,or comma) in every line for file1, dont know much about sed and i tried with the following:
sed 's/,$//g' file1 > file4
the above command was likely to work but it didnt since i run the the cmp command yieldiing the same error in the same line and character:
cmp file1 file4
file1 file2 are are different char 302 line1
Id appreciate your help in advanced