Replace lines that have no digits with some constant word [closed]












1















I have a file with about 10000 lines like the examples shown below. 
I need to replace the lines that do not contain any digits
with some word; e.g., input
How I can do this please?



Example:



The list I have is like this:



1234561
Winstead
Adesuwa1985
Trinity
Angela41
Anita
Tracey
sdojsodsd


I want results like this, where the lines that do not have any number
are replaced with the word “input”:



1234561
input
Adesuwa1985
input
Angela41
input
input
input









share|improve this question















closed as unclear what you're asking by Scott, fixer1234, Tetsujin, harrymc, Toto Feb 2 at 10:41


Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.














  • 4





    (1) Rather than (just) give 19 examples of what data you have, it would be better if you gave six to eight examples of what you have and what result you want. (2) This sounds like a fairly trivial (easy) problem.  What research have you done?  What have you learned?  What have you tried? … … … … … … … … … … … … Please do not respond in comments; edit your question to make it clearer and more complete.

    – Scott
    Feb 2 at 2:22








  • 2





    you are casting a broad net with your tags. Linux and windows? can you be more specific?

    – glenn jackman
    Feb 2 at 3:12











  • What do you mean by "not have digits" and "(word)"? Does not have digits refer only to anything that is purely alphabetic or does it include ones with a name plus a few digits (given that some are purely numeric)? Is (word) the literal string "(word)" or is that a placeholder for something? What delimits the lines (Linux and Windows are different)?

    – fixer1234
    Feb 2 at 6:33











  • I'm voting to close this question as off-topic because questions must demonstrate a reasonable amount of research & understanding of the problem being solved. Please edit to either a) clearly describe your problem and the research done so far to solve it or b) include attempted solutions plus why they didn't work. In either case, be sure your expected results are clearly presented.

    – Tetsujin
    Feb 2 at 8:06











  • Since you have (somewhat) clarified what you want, I have cleaned up your question a little. But (1) I asked you to shorten the list of examples. OK, you shortened it, from 19 to 13. But you really show only three cases: a string of letters, a string of digits, and a string of letters followed by a string of digits. It’s especially disappointing that you edited the list down to eight examples (including all three cases), and then you totally unnecessarily added five more. (2) This is a trivially easy problem. What research have you done?  What have you learned?  What have you tried? … (Cont’d)

    – Scott
    Feb 2 at 19:29
















1















I have a file with about 10000 lines like the examples shown below. 
I need to replace the lines that do not contain any digits
with some word; e.g., input
How I can do this please?



Example:



The list I have is like this:



1234561
Winstead
Adesuwa1985
Trinity
Angela41
Anita
Tracey
sdojsodsd


I want results like this, where the lines that do not have any number
are replaced with the word “input”:



1234561
input
Adesuwa1985
input
Angela41
input
input
input









share|improve this question















closed as unclear what you're asking by Scott, fixer1234, Tetsujin, harrymc, Toto Feb 2 at 10:41


Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.














  • 4





    (1) Rather than (just) give 19 examples of what data you have, it would be better if you gave six to eight examples of what you have and what result you want. (2) This sounds like a fairly trivial (easy) problem.  What research have you done?  What have you learned?  What have you tried? … … … … … … … … … … … … Please do not respond in comments; edit your question to make it clearer and more complete.

    – Scott
    Feb 2 at 2:22








  • 2





    you are casting a broad net with your tags. Linux and windows? can you be more specific?

    – glenn jackman
    Feb 2 at 3:12











  • What do you mean by "not have digits" and "(word)"? Does not have digits refer only to anything that is purely alphabetic or does it include ones with a name plus a few digits (given that some are purely numeric)? Is (word) the literal string "(word)" or is that a placeholder for something? What delimits the lines (Linux and Windows are different)?

    – fixer1234
    Feb 2 at 6:33











  • I'm voting to close this question as off-topic because questions must demonstrate a reasonable amount of research & understanding of the problem being solved. Please edit to either a) clearly describe your problem and the research done so far to solve it or b) include attempted solutions plus why they didn't work. In either case, be sure your expected results are clearly presented.

    – Tetsujin
    Feb 2 at 8:06











  • Since you have (somewhat) clarified what you want, I have cleaned up your question a little. But (1) I asked you to shorten the list of examples. OK, you shortened it, from 19 to 13. But you really show only three cases: a string of letters, a string of digits, and a string of letters followed by a string of digits. It’s especially disappointing that you edited the list down to eight examples (including all three cases), and then you totally unnecessarily added five more. (2) This is a trivially easy problem. What research have you done?  What have you learned?  What have you tried? … (Cont’d)

    – Scott
    Feb 2 at 19:29














1












1








1








I have a file with about 10000 lines like the examples shown below. 
I need to replace the lines that do not contain any digits
with some word; e.g., input
How I can do this please?



Example:



The list I have is like this:



1234561
Winstead
Adesuwa1985
Trinity
Angela41
Anita
Tracey
sdojsodsd


I want results like this, where the lines that do not have any number
are replaced with the word “input”:



1234561
input
Adesuwa1985
input
Angela41
input
input
input









share|improve this question
















I have a file with about 10000 lines like the examples shown below. 
I need to replace the lines that do not contain any digits
with some word; e.g., input
How I can do this please?



Example:



The list I have is like this:



1234561
Winstead
Adesuwa1985
Trinity
Angela41
Anita
Tracey
sdojsodsd


I want results like this, where the lines that do not have any number
are replaced with the word “input”:



1234561
input
Adesuwa1985
input
Angela41
input
input
input






linux windows command-line notepad++ text-editing






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Feb 2 at 19:27









Scott

15.9k113990




15.9k113990










asked Feb 2 at 1:48









banout chispbanout chisp

62




62




closed as unclear what you're asking by Scott, fixer1234, Tetsujin, harrymc, Toto Feb 2 at 10:41


Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.









closed as unclear what you're asking by Scott, fixer1234, Tetsujin, harrymc, Toto Feb 2 at 10:41


Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.










  • 4





    (1) Rather than (just) give 19 examples of what data you have, it would be better if you gave six to eight examples of what you have and what result you want. (2) This sounds like a fairly trivial (easy) problem.  What research have you done?  What have you learned?  What have you tried? … … … … … … … … … … … … Please do not respond in comments; edit your question to make it clearer and more complete.

    – Scott
    Feb 2 at 2:22








  • 2





    you are casting a broad net with your tags. Linux and windows? can you be more specific?

    – glenn jackman
    Feb 2 at 3:12











  • What do you mean by "not have digits" and "(word)"? Does not have digits refer only to anything that is purely alphabetic or does it include ones with a name plus a few digits (given that some are purely numeric)? Is (word) the literal string "(word)" or is that a placeholder for something? What delimits the lines (Linux and Windows are different)?

    – fixer1234
    Feb 2 at 6:33











  • I'm voting to close this question as off-topic because questions must demonstrate a reasonable amount of research & understanding of the problem being solved. Please edit to either a) clearly describe your problem and the research done so far to solve it or b) include attempted solutions plus why they didn't work. In either case, be sure your expected results are clearly presented.

    – Tetsujin
    Feb 2 at 8:06











  • Since you have (somewhat) clarified what you want, I have cleaned up your question a little. But (1) I asked you to shorten the list of examples. OK, you shortened it, from 19 to 13. But you really show only three cases: a string of letters, a string of digits, and a string of letters followed by a string of digits. It’s especially disappointing that you edited the list down to eight examples (including all three cases), and then you totally unnecessarily added five more. (2) This is a trivially easy problem. What research have you done?  What have you learned?  What have you tried? … (Cont’d)

    – Scott
    Feb 2 at 19:29














  • 4





    (1) Rather than (just) give 19 examples of what data you have, it would be better if you gave six to eight examples of what you have and what result you want. (2) This sounds like a fairly trivial (easy) problem.  What research have you done?  What have you learned?  What have you tried? … … … … … … … … … … … … Please do not respond in comments; edit your question to make it clearer and more complete.

    – Scott
    Feb 2 at 2:22








  • 2





    you are casting a broad net with your tags. Linux and windows? can you be more specific?

    – glenn jackman
    Feb 2 at 3:12











  • What do you mean by "not have digits" and "(word)"? Does not have digits refer only to anything that is purely alphabetic or does it include ones with a name plus a few digits (given that some are purely numeric)? Is (word) the literal string "(word)" or is that a placeholder for something? What delimits the lines (Linux and Windows are different)?

    – fixer1234
    Feb 2 at 6:33











  • I'm voting to close this question as off-topic because questions must demonstrate a reasonable amount of research & understanding of the problem being solved. Please edit to either a) clearly describe your problem and the research done so far to solve it or b) include attempted solutions plus why they didn't work. In either case, be sure your expected results are clearly presented.

    – Tetsujin
    Feb 2 at 8:06











  • Since you have (somewhat) clarified what you want, I have cleaned up your question a little. But (1) I asked you to shorten the list of examples. OK, you shortened it, from 19 to 13. But you really show only three cases: a string of letters, a string of digits, and a string of letters followed by a string of digits. It’s especially disappointing that you edited the list down to eight examples (including all three cases), and then you totally unnecessarily added five more. (2) This is a trivially easy problem. What research have you done?  What have you learned?  What have you tried? … (Cont’d)

    – Scott
    Feb 2 at 19:29








4




4





(1) Rather than (just) give 19 examples of what data you have, it would be better if you gave six to eight examples of what you have and what result you want. (2) This sounds like a fairly trivial (easy) problem.  What research have you done?  What have you learned?  What have you tried? … … … … … … … … … … … … Please do not respond in comments; edit your question to make it clearer and more complete.

– Scott
Feb 2 at 2:22







(1) Rather than (just) give 19 examples of what data you have, it would be better if you gave six to eight examples of what you have and what result you want. (2) This sounds like a fairly trivial (easy) problem.  What research have you done?  What have you learned?  What have you tried? … … … … … … … … … … … … Please do not respond in comments; edit your question to make it clearer and more complete.

– Scott
Feb 2 at 2:22






2




2





you are casting a broad net with your tags. Linux and windows? can you be more specific?

– glenn jackman
Feb 2 at 3:12





you are casting a broad net with your tags. Linux and windows? can you be more specific?

– glenn jackman
Feb 2 at 3:12













What do you mean by "not have digits" and "(word)"? Does not have digits refer only to anything that is purely alphabetic or does it include ones with a name plus a few digits (given that some are purely numeric)? Is (word) the literal string "(word)" or is that a placeholder for something? What delimits the lines (Linux and Windows are different)?

– fixer1234
Feb 2 at 6:33





What do you mean by "not have digits" and "(word)"? Does not have digits refer only to anything that is purely alphabetic or does it include ones with a name plus a few digits (given that some are purely numeric)? Is (word) the literal string "(word)" or is that a placeholder for something? What delimits the lines (Linux and Windows are different)?

– fixer1234
Feb 2 at 6:33













I'm voting to close this question as off-topic because questions must demonstrate a reasonable amount of research & understanding of the problem being solved. Please edit to either a) clearly describe your problem and the research done so far to solve it or b) include attempted solutions plus why they didn't work. In either case, be sure your expected results are clearly presented.

– Tetsujin
Feb 2 at 8:06





I'm voting to close this question as off-topic because questions must demonstrate a reasonable amount of research & understanding of the problem being solved. Please edit to either a) clearly describe your problem and the research done so far to solve it or b) include attempted solutions plus why they didn't work. In either case, be sure your expected results are clearly presented.

– Tetsujin
Feb 2 at 8:06













Since you have (somewhat) clarified what you want, I have cleaned up your question a little. But (1) I asked you to shorten the list of examples. OK, you shortened it, from 19 to 13. But you really show only three cases: a string of letters, a string of digits, and a string of letters followed by a string of digits. It’s especially disappointing that you edited the list down to eight examples (including all three cases), and then you totally unnecessarily added five more. (2) This is a trivially easy problem. What research have you done?  What have you learned?  What have you tried? … (Cont’d)

– Scott
Feb 2 at 19:29





Since you have (somewhat) clarified what you want, I have cleaned up your question a little. But (1) I asked you to shorten the list of examples. OK, you shortened it, from 19 to 13. But you really show only three cases: a string of letters, a string of digits, and a string of letters followed by a string of digits. It’s especially disappointing that you edited the list down to eight examples (including all three cases), and then you totally unnecessarily added five more. (2) This is a trivially easy problem. What research have you done?  What have you learned?  What have you tried? … (Cont’d)

– Scott
Feb 2 at 19:29










0






active

oldest

votes

















0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes

Popular posts from this blog

How to reconfigure Docker Trusted Registry 2.x.x to use CEPH FS mount instead of NFS and other traditional...

is 'sed' thread safe

How to make a Squid Proxy server?