Show only lines which contain numbers [closed]

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP












-2















I have a file with the following lines:



irakli1
iraklikairakli
ikarkalsi1
iarksldisrii3
irakli


and I want to show only the lines which contain numbers.



I tried this but it is not working:



sed -n '/a/'p irakli.txt









share|improve this question















closed as unclear what you're asking by G-Man, Jeff Schaller, Stephen Harris, JigglyNaga, RalfFriedl Jan 3 at 14:09


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.










  • 1





    Do you mean that you only want to print the lines that contains a number?

    – Nasir Riley
    Dec 30 '18 at 22:04











  • Please add your desired output for that sample input to your question.

    – Cyrus
    Dec 31 '18 at 8:50















-2















I have a file with the following lines:



irakli1
iraklikairakli
ikarkalsi1
iarksldisrii3
irakli


and I want to show only the lines which contain numbers.



I tried this but it is not working:



sed -n '/a/'p irakli.txt









share|improve this question















closed as unclear what you're asking by G-Man, Jeff Schaller, Stephen Harris, JigglyNaga, RalfFriedl Jan 3 at 14:09


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.










  • 1





    Do you mean that you only want to print the lines that contains a number?

    – Nasir Riley
    Dec 30 '18 at 22:04











  • Please add your desired output for that sample input to your question.

    – Cyrus
    Dec 31 '18 at 8:50













-2












-2








-2








I have a file with the following lines:



irakli1
iraklikairakli
ikarkalsi1
iarksldisrii3
irakli


and I want to show only the lines which contain numbers.



I tried this but it is not working:



sed -n '/a/'p irakli.txt









share|improve this question
















I have a file with the following lines:



irakli1
iraklikairakli
ikarkalsi1
iarksldisrii3
irakli


and I want to show only the lines which contain numbers.



I tried this but it is not working:



sed -n '/a/'p irakli.txt






sed grep find






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jan 1 at 8:51









valiano

200111




200111










asked Dec 30 '18 at 21:54









IrakliIrakli

143




143




closed as unclear what you're asking by G-Man, Jeff Schaller, Stephen Harris, JigglyNaga, RalfFriedl Jan 3 at 14:09


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 G-Man, Jeff Schaller, Stephen Harris, JigglyNaga, RalfFriedl Jan 3 at 14:09


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.









  • 1





    Do you mean that you only want to print the lines that contains a number?

    – Nasir Riley
    Dec 30 '18 at 22:04











  • Please add your desired output for that sample input to your question.

    – Cyrus
    Dec 31 '18 at 8:50












  • 1





    Do you mean that you only want to print the lines that contains a number?

    – Nasir Riley
    Dec 30 '18 at 22:04











  • Please add your desired output for that sample input to your question.

    – Cyrus
    Dec 31 '18 at 8:50







1




1





Do you mean that you only want to print the lines that contains a number?

– Nasir Riley
Dec 30 '18 at 22:04





Do you mean that you only want to print the lines that contains a number?

– Nasir Riley
Dec 30 '18 at 22:04













Please add your desired output for that sample input to your question.

– Cyrus
Dec 31 '18 at 8:50





Please add your desired output for that sample input to your question.

– Cyrus
Dec 31 '18 at 8:50










1 Answer
1






active

oldest

votes


















2














A simple one with grep



grep '[0-9]' irakli.txt


with the file snippet you supplied, you would end up with



irakli1
ikarkalsi1
iarksldisrii3





share|improve this answer























  • can you please time how to Fill in results? for example result = name i want to write eman

    – Irakli
    Dec 30 '18 at 22:07







  • 5





    Sorry, I don't quite understand what you are asking. Could you rephrase the question?

    – Torin
    Dec 30 '18 at 22:12






  • 1





    @Irakli, do you mean result=$(grep '[0-9] irakli.txt)

    – glenn jackman
    Dec 31 '18 at 14:16

















1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









2














A simple one with grep



grep '[0-9]' irakli.txt


with the file snippet you supplied, you would end up with



irakli1
ikarkalsi1
iarksldisrii3





share|improve this answer























  • can you please time how to Fill in results? for example result = name i want to write eman

    – Irakli
    Dec 30 '18 at 22:07







  • 5





    Sorry, I don't quite understand what you are asking. Could you rephrase the question?

    – Torin
    Dec 30 '18 at 22:12






  • 1





    @Irakli, do you mean result=$(grep '[0-9] irakli.txt)

    – glenn jackman
    Dec 31 '18 at 14:16















2














A simple one with grep



grep '[0-9]' irakli.txt


with the file snippet you supplied, you would end up with



irakli1
ikarkalsi1
iarksldisrii3





share|improve this answer























  • can you please time how to Fill in results? for example result = name i want to write eman

    – Irakli
    Dec 30 '18 at 22:07







  • 5





    Sorry, I don't quite understand what you are asking. Could you rephrase the question?

    – Torin
    Dec 30 '18 at 22:12






  • 1





    @Irakli, do you mean result=$(grep '[0-9] irakli.txt)

    – glenn jackman
    Dec 31 '18 at 14:16













2












2








2







A simple one with grep



grep '[0-9]' irakli.txt


with the file snippet you supplied, you would end up with



irakli1
ikarkalsi1
iarksldisrii3





share|improve this answer













A simple one with grep



grep '[0-9]' irakli.txt


with the file snippet you supplied, you would end up with



irakli1
ikarkalsi1
iarksldisrii3






share|improve this answer












share|improve this answer



share|improve this answer










answered Dec 30 '18 at 22:04









TorinTorin

37517




37517












  • can you please time how to Fill in results? for example result = name i want to write eman

    – Irakli
    Dec 30 '18 at 22:07







  • 5





    Sorry, I don't quite understand what you are asking. Could you rephrase the question?

    – Torin
    Dec 30 '18 at 22:12






  • 1





    @Irakli, do you mean result=$(grep '[0-9] irakli.txt)

    – glenn jackman
    Dec 31 '18 at 14:16

















  • can you please time how to Fill in results? for example result = name i want to write eman

    – Irakli
    Dec 30 '18 at 22:07







  • 5





    Sorry, I don't quite understand what you are asking. Could you rephrase the question?

    – Torin
    Dec 30 '18 at 22:12






  • 1





    @Irakli, do you mean result=$(grep '[0-9] irakli.txt)

    – glenn jackman
    Dec 31 '18 at 14:16
















can you please time how to Fill in results? for example result = name i want to write eman

– Irakli
Dec 30 '18 at 22:07






can you please time how to Fill in results? for example result = name i want to write eman

– Irakli
Dec 30 '18 at 22:07





5




5





Sorry, I don't quite understand what you are asking. Could you rephrase the question?

– Torin
Dec 30 '18 at 22:12





Sorry, I don't quite understand what you are asking. Could you rephrase the question?

– Torin
Dec 30 '18 at 22:12




1




1





@Irakli, do you mean result=$(grep '[0-9] irakli.txt)

– glenn jackman
Dec 31 '18 at 14:16





@Irakli, do you mean result=$(grep '[0-9] irakli.txt)

– glenn jackman
Dec 31 '18 at 14:16


Popular posts from this blog

Peggy Mitchell

Palaiologos

The Forum (Inglewood, California)