Question

I'm trying to find a way to print the text from a specific line number of an HTML file.

I've found ways to print the line numbers of a text search, but I want to do the reverse, printing the text of the line number, where the line number stays constant but the text there may change.

Était-ce utile?

La solution

One way

$ cat foo.txt
dog
bird
monkey

$ sed '2!d' foo.txt
bird

In simple terms, if not line 2, delete

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top