Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Formatting

Status
Not open for further replies.

hill007

Technical User
Mar 9, 2004
60
US
Hi,
I have a series of dataset in the format below:
C6.L30 00564 22-MAY-1986 M 27-MAY
C6.L30 00564 23-MAY-1986 3.1 27-MAY
C6.L30 00564 24-MAY-1986 M 27-MAY
C6.L30 00564 25-MAY-1986 M 27-MAY
C6.L30 00564 26-SEP-1986 2 27-MAY

I want to get the final output as:

22-MAY-1986
23-MAY-1986 3.1
24-MAY-1986
25-MAY-1986
26-SEP-1986 2

I have tried {print ($3,$4)}, however, column 5, where 'M' is merges into final column 2.

Any help appreciated.
Thanks.


 
Something like this ?
awk '{print substr($0,18,22)}' /path/to/input

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Code:
nawk '{print $3, match($4, "[a-zA-Z]+") ? "" : $4}' file

vlad
+----------------------------+
| #include<disclaimer.h> |
+----------------------------+
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top