Skip to content
Advertisement

Removing text after a specific delimeter

I extract all the links from a specific webpage using lynx.

JavaScript

It give the following output:

JavaScript

I want to do following things.

  1. Output only those links which contains /video/
  2. remove the title in the end of the link http://www.example.com/video/1001/The-title-of-video should output only http://www.example.com/video/1001/

Advertisement

Answer

Use grep to filter the output, sed to remove the title:

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