awk remove lines with digits at end
Clash Royale CLAN TAG#URR8PPP
up vote
0
down vote
favorite
I want to remove lines with digits at the end of the string,
example of input:
example123
example
example12
example43
expected output:
example
text-processing awk
add a comment |Â
up vote
0
down vote
favorite
I want to remove lines with digits at the end of the string,
example of input:
example123
example
example12
example43
expected output:
example
text-processing awk
2
Digits or digit? (How many qualify for removal?)
â Jeff Schaller
May 8 at 19:07
2
Possible duplicate of sed remove digits from end of stirng
â Kusalananda
May 9 at 9:30
1
@Kusalananda and those seeing a VTC duplicate to unix.stackexchange.com/questions/432332/â¦, it sounds to me like they want to remove/delete lines that end in digits, not "remove just the digits"
â Jeff Schaller
May 9 at 11:00
1
I still want to know how many digits (s
being used twice in the Q/title) are needed at the end to remove the line; 1, or more?
â Jeff Schaller
May 9 at 11:01
add a comment |Â
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I want to remove lines with digits at the end of the string,
example of input:
example123
example
example12
example43
expected output:
example
text-processing awk
I want to remove lines with digits at the end of the string,
example of input:
example123
example
example12
example43
expected output:
example
text-processing awk
edited May 8 at 19:06
Jeff Schaller
31.1k846105
31.1k846105
asked May 8 at 18:59
awk
41
41
2
Digits or digit? (How many qualify for removal?)
â Jeff Schaller
May 8 at 19:07
2
Possible duplicate of sed remove digits from end of stirng
â Kusalananda
May 9 at 9:30
1
@Kusalananda and those seeing a VTC duplicate to unix.stackexchange.com/questions/432332/â¦, it sounds to me like they want to remove/delete lines that end in digits, not "remove just the digits"
â Jeff Schaller
May 9 at 11:00
1
I still want to know how many digits (s
being used twice in the Q/title) are needed at the end to remove the line; 1, or more?
â Jeff Schaller
May 9 at 11:01
add a comment |Â
2
Digits or digit? (How many qualify for removal?)
â Jeff Schaller
May 8 at 19:07
2
Possible duplicate of sed remove digits from end of stirng
â Kusalananda
May 9 at 9:30
1
@Kusalananda and those seeing a VTC duplicate to unix.stackexchange.com/questions/432332/â¦, it sounds to me like they want to remove/delete lines that end in digits, not "remove just the digits"
â Jeff Schaller
May 9 at 11:00
1
I still want to know how many digits (s
being used twice in the Q/title) are needed at the end to remove the line; 1, or more?
â Jeff Schaller
May 9 at 11:01
2
2
Digits or digit? (How many qualify for removal?)
â Jeff Schaller
May 8 at 19:07
Digits or digit? (How many qualify for removal?)
â Jeff Schaller
May 8 at 19:07
2
2
Possible duplicate of sed remove digits from end of stirng
â Kusalananda
May 9 at 9:30
Possible duplicate of sed remove digits from end of stirng
â Kusalananda
May 9 at 9:30
1
1
@Kusalananda and those seeing a VTC duplicate to unix.stackexchange.com/questions/432332/â¦, it sounds to me like they want to remove/delete lines that end in digits, not "remove just the digits"
â Jeff Schaller
May 9 at 11:00
@Kusalananda and those seeing a VTC duplicate to unix.stackexchange.com/questions/432332/â¦, it sounds to me like they want to remove/delete lines that end in digits, not "remove just the digits"
â Jeff Schaller
May 9 at 11:00
1
1
I still want to know how many digits (
s
being used twice in the Q/title) are needed at the end to remove the line; 1, or more?â Jeff Schaller
May 9 at 11:01
I still want to know how many digits (
s
being used twice in the Q/title) are needed at the end to remove the line; 1, or more?â Jeff Schaller
May 9 at 11:01
add a comment |Â
3 Answers
3
active
oldest
votes
up vote
3
down vote
Very simple to do:
awk '/[^0-9]$/ print ' inputfile
Or, if you care to preserve empty lines,
awk '! /[0-9]$/ print ' inputfile
add a comment |Â
up vote
1
down vote
Or in case you are interested in grep
too, following simple grep
may help also.
grep -v '[0-9]$' Input_file
add a comment |Â
up vote
1
down vote
sed -e '/[0-9]$/d' input-file.txt
add a comment |Â
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
3
down vote
Very simple to do:
awk '/[^0-9]$/ print ' inputfile
Or, if you care to preserve empty lines,
awk '! /[0-9]$/ print ' inputfile
add a comment |Â
up vote
3
down vote
Very simple to do:
awk '/[^0-9]$/ print ' inputfile
Or, if you care to preserve empty lines,
awk '! /[0-9]$/ print ' inputfile
add a comment |Â
up vote
3
down vote
up vote
3
down vote
Very simple to do:
awk '/[^0-9]$/ print ' inputfile
Or, if you care to preserve empty lines,
awk '! /[0-9]$/ print ' inputfile
Very simple to do:
awk '/[^0-9]$/ print ' inputfile
Or, if you care to preserve empty lines,
awk '! /[0-9]$/ print ' inputfile
edited May 8 at 20:08
answered May 8 at 19:00
DopeGhoti
40k54779
40k54779
add a comment |Â
add a comment |Â
up vote
1
down vote
Or in case you are interested in grep
too, following simple grep
may help also.
grep -v '[0-9]$' Input_file
add a comment |Â
up vote
1
down vote
Or in case you are interested in grep
too, following simple grep
may help also.
grep -v '[0-9]$' Input_file
add a comment |Â
up vote
1
down vote
up vote
1
down vote
Or in case you are interested in grep
too, following simple grep
may help also.
grep -v '[0-9]$' Input_file
Or in case you are interested in grep
too, following simple grep
may help also.
grep -v '[0-9]$' Input_file
answered May 9 at 0:54
RavinderSingh13
1235
1235
add a comment |Â
add a comment |Â
up vote
1
down vote
sed -e '/[0-9]$/d' input-file.txt
add a comment |Â
up vote
1
down vote
sed -e '/[0-9]$/d' input-file.txt
add a comment |Â
up vote
1
down vote
up vote
1
down vote
sed -e '/[0-9]$/d' input-file.txt
sed -e '/[0-9]$/d' input-file.txt
answered May 9 at 3:52
Rakesh Sharma
413
413
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f442615%2fawk-remove-lines-with-digits-at-end%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
2
Digits or digit? (How many qualify for removal?)
â Jeff Schaller
May 8 at 19:07
2
Possible duplicate of sed remove digits from end of stirng
â Kusalananda
May 9 at 9:30
1
@Kusalananda and those seeing a VTC duplicate to unix.stackexchange.com/questions/432332/â¦, it sounds to me like they want to remove/delete lines that end in digits, not "remove just the digits"
â Jeff Schaller
May 9 at 11:00
1
I still want to know how many digits (
s
being used twice in the Q/title) are needed at the end to remove the line; 1, or more?â Jeff Schaller
May 9 at 11:01