delete first 2 characters for each line, please help

hi,

./R1_970330_210505.sard
./R1_970403_223412.sard
./R1_970626_115235.sard
./R1_970626_214344.sard
./R1_970716_234214.sard
...
...
...

for these strings, i wanna remove the ./ for each line
how can i do that?

i know it could possibly be done by sed, but i really have not idea how to use that command

thanks a lot!

You don't need sed for such a simple task:

cut -c3- file
1 Like

For completeness, here is the sed command:

sed 's/..//' file
1 Like

AWK one

awk -F"/" '{print $2}' urfile

sed only ..

  
[root@SKS Shirish]# echo "123 shirish" > a
[root@SKS Shirish]# cat a
123 shirish
[root@SKS Shirish]#  sed -i 's/^.\{2\}//g'   a
[root@SKS Shirish]# cat a
3 shirish
[root@SKS Shirish]#
 

Hope It will help u bit ...

FOR YOUR CONTENT ...

[root@SKS Shirish]# cat ab
./R1_970330_210505.sard
./R1_970403_223412.sard
./R1_970626_115235.sard
./R1_970626_214344.sard
./R1_970716_234214.sard
[root@SKS Shirish]# sed -i 's/^.\{2\}//g' ab
[root@SKS Shirish]# cat ab
R1_970330_210505.sard
R1_970403_223412.sard
R1_970626_115235.sard
R1_970626_214344.sard
R1_970716_234214.sard
[root@SKS Shirish]#
 

--Shirish Shukla