How to prepend a string to only the lines of text which are numbers The 2019 Stack Overflow Developer Survey Results Are InAutomatically doubling the value of numbers in a string in multiple filesHow can I count lines of differently named files, and write the outcome to a csv file?Multiplying numbers in file by random numbersHow to get line from a file using line number and edit it easily?Only in lines with a specific string replace another stringDelete all lines from middle of a line matching a string until the second string match is foundInsert a line of text after the line containing the last occurence of a specified wordDelete ranges of lines, but skip the comments which come in between the linesHow to recursively go through all text files in a directory to fetch the desired line, and write these lines to same text file?grep and sed only the numbers from a text file's line
How do you say "canon" as in "official for a story universe"?
What can other administrators access on my machine?
changing state of an LED using a pushbutton leads to unstable simulation on SimulIDE
Why isn't airport relocation done gradually?
How can I fix this gap between bookcases I made?
I am seven letter word. Find me Who Am I?
How to deal with fear of taking dependencies
Is there a general name for the setup in which payoffs are not known exactly but players try to influence each other's perception of the payoffs?
Operational amplifier basics
I see my dog run
Return to UK after being refused entry years previously
Pristine Bit Checking
Time travel alters history but people keep saying nothing's changed
Flying Bloodthirsty Lampshades
What is the motivation for a law requiring 2 parties to consent for recording a conversation
Why is the maximum length of OpenWrt’s root password 8 characters?
How to reverse every other sublist of a list?
Did Section 31 appear in Star Trek: The Next Generation?
What is the meaning of Triage in Cybersec world?
Which Sci-Fi work first showed weapon of galactic-scale mass destruction?
Find number from a line and get the quotient
Possible to make Vertices from overlapping Edges?
Why can Shazam fly?
Not able to paste multiple components
How to prepend a string to only the lines of text which are numbers
The 2019 Stack Overflow Developer Survey Results Are InAutomatically doubling the value of numbers in a string in multiple filesHow can I count lines of differently named files, and write the outcome to a csv file?Multiplying numbers in file by random numbersHow to get line from a file using line number and edit it easily?Only in lines with a specific string replace another stringDelete all lines from middle of a line matching a string until the second string match is foundInsert a line of text after the line containing the last occurence of a specified wordDelete ranges of lines, but skip the comments which come in between the linesHow to recursively go through all text files in a directory to fetch the desired line, and write these lines to same text file?grep and sed only the numbers from a text file's line
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
Suppose I have 6 lines of text.
Series
Of
Word
73914
Again
Word
I need to prepend a string to the beginning of lines that contain ONLY numbers. Say I insert number-
Series
Of
Word
number-73914
Again
Word
Currently I run two commands to achieve the desired result. I wonder if there is a more efficient method.
Note: There are 1000+ lines, so preferably this applies to all lines ( I already state it ).
command-line text-processing sed awk
add a comment |
Suppose I have 6 lines of text.
Series
Of
Word
73914
Again
Word
I need to prepend a string to the beginning of lines that contain ONLY numbers. Say I insert number-
Series
Of
Word
number-73914
Again
Word
Currently I run two commands to achieve the desired result. I wonder if there is a more efficient method.
Note: There are 1000+ lines, so preferably this applies to all lines ( I already state it ).
command-line text-processing sed awk
What do you want to do with a line like1st word 2nd word
?
– glenn jackman
Mar 29 at 18:00
And do you want only lines that are entirely a number or that start with a number? E.g. would you want123abc
to be changed tonumber-123abc
or not?
– Kevin
Mar 29 at 19:57
add a comment |
Suppose I have 6 lines of text.
Series
Of
Word
73914
Again
Word
I need to prepend a string to the beginning of lines that contain ONLY numbers. Say I insert number-
Series
Of
Word
number-73914
Again
Word
Currently I run two commands to achieve the desired result. I wonder if there is a more efficient method.
Note: There are 1000+ lines, so preferably this applies to all lines ( I already state it ).
command-line text-processing sed awk
Suppose I have 6 lines of text.
Series
Of
Word
73914
Again
Word
I need to prepend a string to the beginning of lines that contain ONLY numbers. Say I insert number-
Series
Of
Word
number-73914
Again
Word
Currently I run two commands to achieve the desired result. I wonder if there is a more efficient method.
Note: There are 1000+ lines, so preferably this applies to all lines ( I already state it ).
command-line text-processing sed awk
command-line text-processing sed awk
edited Mar 29 at 9:21
Martin Thornton
2,56361830
2,56361830
asked Mar 29 at 3:24
EmmetEmmet
7,79322345
7,79322345
What do you want to do with a line like1st word 2nd word
?
– glenn jackman
Mar 29 at 18:00
And do you want only lines that are entirely a number or that start with a number? E.g. would you want123abc
to be changed tonumber-123abc
or not?
– Kevin
Mar 29 at 19:57
add a comment |
What do you want to do with a line like1st word 2nd word
?
– glenn jackman
Mar 29 at 18:00
And do you want only lines that are entirely a number or that start with a number? E.g. would you want123abc
to be changed tonumber-123abc
or not?
– Kevin
Mar 29 at 19:57
What do you want to do with a line like
1st word 2nd word
?– glenn jackman
Mar 29 at 18:00
What do you want to do with a line like
1st word 2nd word
?– glenn jackman
Mar 29 at 18:00
And do you want only lines that are entirely a number or that start with a number? E.g. would you want
123abc
to be changed to number-123abc
or not?– Kevin
Mar 29 at 19:57
And do you want only lines that are entirely a number or that start with a number? E.g. would you want
123abc
to be changed to number-123abc
or not?– Kevin
Mar 29 at 19:57
add a comment |
4 Answers
4
active
oldest
votes
sed
can do that:
$ sed 's/^[[:digit:]]*$/number-&/' input.txt
Series
Of
Word
number-73914
Again
Word
In case we want to account for empty lines, we'd use +
and -r
option:
$ sed -r 's/^[[:digit:]]+$/number-&/' input.txt
Series
Of
Word
number-73914
Again
Word
line below is empty
line above is empty
Once you verify everything is proper, you can use -i
option to edit the file itself, i.e. sed -i ...
. Otherwise, you can always make a copy of the file with sed 's/^[[:digit:]]*$/number-&/' input.txt > output.txt
Note that this assumes consistent file format, with no leading whitespaces or trailing whitespaces on each line.
And here's Python as extra:
$ python3 -c 'import sys; print("n".join([ "number-" + i.strip() if i.strip().isnumeric() else i.strip() for i in sys.stdin]))' < input.txt
Series
Of
Word
number-73914
Again
Word
line below is empty
line above is empty
2
I often use the "substitute if match" variant for things like this/^[[:digit:]]+$/ s/^/number-/'
– steeldriver
Mar 29 at 7:29
Thanks for the complete instruction, I'm a total noob when it comes to text processing :-O
– Emmet
Mar 29 at 9:41
add a comment |
One way using awk:
awk '/^[0-9]+$/$0="number-"$0;1' file
I also seekawk
solution, thanks ! 1+
– Emmet
Mar 29 at 9:42
add a comment |
lines that contain ONLY numbers
It's unclear whether you mean numbers or just 0-9. Here's a Perl one-liner that picks out the likes of 123, 3.14 and 1e-12 while ignoring various representations of infinity and not-a-number:
$ perl -MScalar::Util -ne 'chomp; if (!(m/^s/ || m/^[+-]?inf(?:inity)?$/i || m/^nan$/i) && Scalar::Util::looks_like_number($_)) print("N:"); print("$_n");' <x
a
N:123
N:+1
N:-1
1
b
1a
N:3.14
c
3.1415926 is an approximation of pi
N:1e-12
inf
Inf
Infinity
Infinity +1 sword
+Infinity
-infinity
NaN
1/2
I changed the prefix to "N:" simply because "number--1" looks a bit rubbish. Note that this treats " 1", for example, as not numeric. If that is undesirable behaviour, do not include the "m/^s/" test for leading whitespace.
If you mean "0-9", Sergiy's sed solution above is fine.
Probably an overkill for this question, but still awesome ! +1
– Sergiy Kolodyazhnyy
Mar 29 at 12:06
add a comment |
You can try this
$cat input.txt
Series
Of
Word
73914
Again
Word
$awk ' if($1 ~/[0-9]/) printf "number - %sn",$1; else print $1 ' input.txt
Series
Of
Word
number - 73914
Again
Word
Usingif
statement, nice ! Thank you :D
– Emmet
Mar 29 at 9:42
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "89"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
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
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1129567%2fhow-to-prepend-a-string-to-only-the-lines-of-text-which-are-numbers%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
4 Answers
4
active
oldest
votes
4 Answers
4
active
oldest
votes
active
oldest
votes
active
oldest
votes
sed
can do that:
$ sed 's/^[[:digit:]]*$/number-&/' input.txt
Series
Of
Word
number-73914
Again
Word
In case we want to account for empty lines, we'd use +
and -r
option:
$ sed -r 's/^[[:digit:]]+$/number-&/' input.txt
Series
Of
Word
number-73914
Again
Word
line below is empty
line above is empty
Once you verify everything is proper, you can use -i
option to edit the file itself, i.e. sed -i ...
. Otherwise, you can always make a copy of the file with sed 's/^[[:digit:]]*$/number-&/' input.txt > output.txt
Note that this assumes consistent file format, with no leading whitespaces or trailing whitespaces on each line.
And here's Python as extra:
$ python3 -c 'import sys; print("n".join([ "number-" + i.strip() if i.strip().isnumeric() else i.strip() for i in sys.stdin]))' < input.txt
Series
Of
Word
number-73914
Again
Word
line below is empty
line above is empty
2
I often use the "substitute if match" variant for things like this/^[[:digit:]]+$/ s/^/number-/'
– steeldriver
Mar 29 at 7:29
Thanks for the complete instruction, I'm a total noob when it comes to text processing :-O
– Emmet
Mar 29 at 9:41
add a comment |
sed
can do that:
$ sed 's/^[[:digit:]]*$/number-&/' input.txt
Series
Of
Word
number-73914
Again
Word
In case we want to account for empty lines, we'd use +
and -r
option:
$ sed -r 's/^[[:digit:]]+$/number-&/' input.txt
Series
Of
Word
number-73914
Again
Word
line below is empty
line above is empty
Once you verify everything is proper, you can use -i
option to edit the file itself, i.e. sed -i ...
. Otherwise, you can always make a copy of the file with sed 's/^[[:digit:]]*$/number-&/' input.txt > output.txt
Note that this assumes consistent file format, with no leading whitespaces or trailing whitespaces on each line.
And here's Python as extra:
$ python3 -c 'import sys; print("n".join([ "number-" + i.strip() if i.strip().isnumeric() else i.strip() for i in sys.stdin]))' < input.txt
Series
Of
Word
number-73914
Again
Word
line below is empty
line above is empty
2
I often use the "substitute if match" variant for things like this/^[[:digit:]]+$/ s/^/number-/'
– steeldriver
Mar 29 at 7:29
Thanks for the complete instruction, I'm a total noob when it comes to text processing :-O
– Emmet
Mar 29 at 9:41
add a comment |
sed
can do that:
$ sed 's/^[[:digit:]]*$/number-&/' input.txt
Series
Of
Word
number-73914
Again
Word
In case we want to account for empty lines, we'd use +
and -r
option:
$ sed -r 's/^[[:digit:]]+$/number-&/' input.txt
Series
Of
Word
number-73914
Again
Word
line below is empty
line above is empty
Once you verify everything is proper, you can use -i
option to edit the file itself, i.e. sed -i ...
. Otherwise, you can always make a copy of the file with sed 's/^[[:digit:]]*$/number-&/' input.txt > output.txt
Note that this assumes consistent file format, with no leading whitespaces or trailing whitespaces on each line.
And here's Python as extra:
$ python3 -c 'import sys; print("n".join([ "number-" + i.strip() if i.strip().isnumeric() else i.strip() for i in sys.stdin]))' < input.txt
Series
Of
Word
number-73914
Again
Word
line below is empty
line above is empty
sed
can do that:
$ sed 's/^[[:digit:]]*$/number-&/' input.txt
Series
Of
Word
number-73914
Again
Word
In case we want to account for empty lines, we'd use +
and -r
option:
$ sed -r 's/^[[:digit:]]+$/number-&/' input.txt
Series
Of
Word
number-73914
Again
Word
line below is empty
line above is empty
Once you verify everything is proper, you can use -i
option to edit the file itself, i.e. sed -i ...
. Otherwise, you can always make a copy of the file with sed 's/^[[:digit:]]*$/number-&/' input.txt > output.txt
Note that this assumes consistent file format, with no leading whitespaces or trailing whitespaces on each line.
And here's Python as extra:
$ python3 -c 'import sys; print("n".join([ "number-" + i.strip() if i.strip().isnumeric() else i.strip() for i in sys.stdin]))' < input.txt
Series
Of
Word
number-73914
Again
Word
line below is empty
line above is empty
edited Mar 29 at 7:07
answered Mar 29 at 7:00
Sergiy KolodyazhnyySergiy Kolodyazhnyy
75.1k9155327
75.1k9155327
2
I often use the "substitute if match" variant for things like this/^[[:digit:]]+$/ s/^/number-/'
– steeldriver
Mar 29 at 7:29
Thanks for the complete instruction, I'm a total noob when it comes to text processing :-O
– Emmet
Mar 29 at 9:41
add a comment |
2
I often use the "substitute if match" variant for things like this/^[[:digit:]]+$/ s/^/number-/'
– steeldriver
Mar 29 at 7:29
Thanks for the complete instruction, I'm a total noob when it comes to text processing :-O
– Emmet
Mar 29 at 9:41
2
2
I often use the "substitute if match" variant for things like this
/^[[:digit:]]+$/ s/^/number-/'
– steeldriver
Mar 29 at 7:29
I often use the "substitute if match" variant for things like this
/^[[:digit:]]+$/ s/^/number-/'
– steeldriver
Mar 29 at 7:29
Thanks for the complete instruction, I'm a total noob when it comes to text processing :-O
– Emmet
Mar 29 at 9:41
Thanks for the complete instruction, I'm a total noob when it comes to text processing :-O
– Emmet
Mar 29 at 9:41
add a comment |
One way using awk:
awk '/^[0-9]+$/$0="number-"$0;1' file
I also seekawk
solution, thanks ! 1+
– Emmet
Mar 29 at 9:42
add a comment |
One way using awk:
awk '/^[0-9]+$/$0="number-"$0;1' file
I also seekawk
solution, thanks ! 1+
– Emmet
Mar 29 at 9:42
add a comment |
One way using awk:
awk '/^[0-9]+$/$0="number-"$0;1' file
One way using awk:
awk '/^[0-9]+$/$0="number-"$0;1' file
answered Mar 29 at 7:04
GuruGuru
52838
52838
I also seekawk
solution, thanks ! 1+
– Emmet
Mar 29 at 9:42
add a comment |
I also seekawk
solution, thanks ! 1+
– Emmet
Mar 29 at 9:42
I also seek
awk
solution, thanks ! 1+– Emmet
Mar 29 at 9:42
I also seek
awk
solution, thanks ! 1+– Emmet
Mar 29 at 9:42
add a comment |
lines that contain ONLY numbers
It's unclear whether you mean numbers or just 0-9. Here's a Perl one-liner that picks out the likes of 123, 3.14 and 1e-12 while ignoring various representations of infinity and not-a-number:
$ perl -MScalar::Util -ne 'chomp; if (!(m/^s/ || m/^[+-]?inf(?:inity)?$/i || m/^nan$/i) && Scalar::Util::looks_like_number($_)) print("N:"); print("$_n");' <x
a
N:123
N:+1
N:-1
1
b
1a
N:3.14
c
3.1415926 is an approximation of pi
N:1e-12
inf
Inf
Infinity
Infinity +1 sword
+Infinity
-infinity
NaN
1/2
I changed the prefix to "N:" simply because "number--1" looks a bit rubbish. Note that this treats " 1", for example, as not numeric. If that is undesirable behaviour, do not include the "m/^s/" test for leading whitespace.
If you mean "0-9", Sergiy's sed solution above is fine.
Probably an overkill for this question, but still awesome ! +1
– Sergiy Kolodyazhnyy
Mar 29 at 12:06
add a comment |
lines that contain ONLY numbers
It's unclear whether you mean numbers or just 0-9. Here's a Perl one-liner that picks out the likes of 123, 3.14 and 1e-12 while ignoring various representations of infinity and not-a-number:
$ perl -MScalar::Util -ne 'chomp; if (!(m/^s/ || m/^[+-]?inf(?:inity)?$/i || m/^nan$/i) && Scalar::Util::looks_like_number($_)) print("N:"); print("$_n");' <x
a
N:123
N:+1
N:-1
1
b
1a
N:3.14
c
3.1415926 is an approximation of pi
N:1e-12
inf
Inf
Infinity
Infinity +1 sword
+Infinity
-infinity
NaN
1/2
I changed the prefix to "N:" simply because "number--1" looks a bit rubbish. Note that this treats " 1", for example, as not numeric. If that is undesirable behaviour, do not include the "m/^s/" test for leading whitespace.
If you mean "0-9", Sergiy's sed solution above is fine.
Probably an overkill for this question, but still awesome ! +1
– Sergiy Kolodyazhnyy
Mar 29 at 12:06
add a comment |
lines that contain ONLY numbers
It's unclear whether you mean numbers or just 0-9. Here's a Perl one-liner that picks out the likes of 123, 3.14 and 1e-12 while ignoring various representations of infinity and not-a-number:
$ perl -MScalar::Util -ne 'chomp; if (!(m/^s/ || m/^[+-]?inf(?:inity)?$/i || m/^nan$/i) && Scalar::Util::looks_like_number($_)) print("N:"); print("$_n");' <x
a
N:123
N:+1
N:-1
1
b
1a
N:3.14
c
3.1415926 is an approximation of pi
N:1e-12
inf
Inf
Infinity
Infinity +1 sword
+Infinity
-infinity
NaN
1/2
I changed the prefix to "N:" simply because "number--1" looks a bit rubbish. Note that this treats " 1", for example, as not numeric. If that is undesirable behaviour, do not include the "m/^s/" test for leading whitespace.
If you mean "0-9", Sergiy's sed solution above is fine.
lines that contain ONLY numbers
It's unclear whether you mean numbers or just 0-9. Here's a Perl one-liner that picks out the likes of 123, 3.14 and 1e-12 while ignoring various representations of infinity and not-a-number:
$ perl -MScalar::Util -ne 'chomp; if (!(m/^s/ || m/^[+-]?inf(?:inity)?$/i || m/^nan$/i) && Scalar::Util::looks_like_number($_)) print("N:"); print("$_n");' <x
a
N:123
N:+1
N:-1
1
b
1a
N:3.14
c
3.1415926 is an approximation of pi
N:1e-12
inf
Inf
Infinity
Infinity +1 sword
+Infinity
-infinity
NaN
1/2
I changed the prefix to "N:" simply because "number--1" looks a bit rubbish. Note that this treats " 1", for example, as not numeric. If that is undesirable behaviour, do not include the "m/^s/" test for leading whitespace.
If you mean "0-9", Sergiy's sed solution above is fine.
answered Mar 29 at 11:56
Chris WilliamsChris Williams
311
311
Probably an overkill for this question, but still awesome ! +1
– Sergiy Kolodyazhnyy
Mar 29 at 12:06
add a comment |
Probably an overkill for this question, but still awesome ! +1
– Sergiy Kolodyazhnyy
Mar 29 at 12:06
Probably an overkill for this question, but still awesome ! +1
– Sergiy Kolodyazhnyy
Mar 29 at 12:06
Probably an overkill for this question, but still awesome ! +1
– Sergiy Kolodyazhnyy
Mar 29 at 12:06
add a comment |
You can try this
$cat input.txt
Series
Of
Word
73914
Again
Word
$awk ' if($1 ~/[0-9]/) printf "number - %sn",$1; else print $1 ' input.txt
Series
Of
Word
number - 73914
Again
Word
Usingif
statement, nice ! Thank you :D
– Emmet
Mar 29 at 9:42
add a comment |
You can try this
$cat input.txt
Series
Of
Word
73914
Again
Word
$awk ' if($1 ~/[0-9]/) printf "number - %sn",$1; else print $1 ' input.txt
Series
Of
Word
number - 73914
Again
Word
Usingif
statement, nice ! Thank you :D
– Emmet
Mar 29 at 9:42
add a comment |
You can try this
$cat input.txt
Series
Of
Word
73914
Again
Word
$awk ' if($1 ~/[0-9]/) printf "number - %sn",$1; else print $1 ' input.txt
Series
Of
Word
number - 73914
Again
Word
You can try this
$cat input.txt
Series
Of
Word
73914
Again
Word
$awk ' if($1 ~/[0-9]/) printf "number - %sn",$1; else print $1 ' input.txt
Series
Of
Word
number - 73914
Again
Word
answered Mar 29 at 7:26
GoronGoron
1669
1669
Usingif
statement, nice ! Thank you :D
– Emmet
Mar 29 at 9:42
add a comment |
Usingif
statement, nice ! Thank you :D
– Emmet
Mar 29 at 9:42
Using
if
statement, nice ! Thank you :D– Emmet
Mar 29 at 9:42
Using
if
statement, nice ! Thank you :D– Emmet
Mar 29 at 9:42
add a comment |
Thanks for contributing an answer to Ask Ubuntu!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
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
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1129567%2fhow-to-prepend-a-string-to-only-the-lines-of-text-which-are-numbers%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
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
Required, but never shown
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
Required, but never shown
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
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
What do you want to do with a line like
1st word 2nd word
?– glenn jackman
Mar 29 at 18:00
And do you want only lines that are entirely a number or that start with a number? E.g. would you want
123abc
to be changed tonumber-123abc
or not?– Kevin
Mar 29 at 19:57