Skip to content
Advertisement

Get a particular string from text file

I need to get a particular string from a text file. the content of my file is below :

JavaScript

The command that i am trying is :

JavaScript

Using this command, I am able to get that particular line in which my string is present. Here is the result of the awk command :

JavaScript

What I want to grep is only “3.0.7” (which is the version) from that line .

Can anyone have any suggestion to do that?

Advertisement

Answer

You can use / and - as field separators and print the third field.

This assumes the format of the lines and position of the information you seek will always be such.

JavaScript
User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement