The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM



View Single Post in UNIX Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 06-28-2007
pbsrinivas pbsrinivas is offline
Registered User
 

Join Date: Jul 2006
Posts: 141
cut last 4 chars

hi

i wanted to cut last 4 chars from a text file

Input

A-B-C-V-15-0115
A-BL-CLE-T-VALUE-0125
M-T-L-G-0115
AT-PR-PE-CCT-0135

Output

0115
0125
0115
0135

I tried cut -f - -d "-" (thinking cut -f 5- -d"-" gives 5 ot end of line so only - should give last but floped)
Reply With Quote
Remove advertisements
!!
Forum Sponsor