I'm sure this is an easy one for the SED folks: Please enlighten me, or point to an existing POST. I tried to search (honest), but didn't find anything close enough:
I have a text file with very predictable patterns:
(example)
Revision: 1.1.3.4
Revision: 1.2.2.1
Revision: 1.18.2.1
Revision: 1.6
Revision: 1.12
I wish to delete any lines that have the four sets of numbers, but keep all those that have fewer. I want my output to contain only:
Revision: 1.6
Revision: 1.12
This is the sed section of my script:
For the limited example above, I get the results I want. But, there will come a time where the 1st, 3rd, and/or 4th numeric will be 2 digits. What is the better 1-line syntax to accomplish my goal?
Thanks in advance for the help!
I have a text file with very predictable patterns:
(example)
Revision: 1.1.3.4
Revision: 1.2.2.1
Revision: 1.18.2.1
Revision: 1.6
Revision: 1.12
I wish to delete any lines that have the four sets of numbers, but keep all those that have fewer. I want my output to contain only:
Revision: 1.6
Revision: 1.12
This is the sed section of my script:
Code:
sed '/[0-9].[0-9].[0-9].[0-9]/d' "mod_list" >"mod_list.tmp"
sed '/[0-9].[0-9][0-9].[0-9].[0-9]/d' "mod_list.tmp" >"mod_list.tmp2"
For the limited example above, I get the results I want. But, there will come a time where the 1st, 3rd, and/or 4th numeric will be 2 digits. What is the better 1-line syntax to accomplish my goal?
Thanks in advance for the help!