Skip to content
Advertisement

Linux sed – remove at start and at end without delete the middle syntax

I am trying to make a automate script.

I am stuck at the place where I take source code line like:

<div class="u-flL condText  "  id="vi-itm-cond" itemprop="itemCondition">
  Seller refurbished
</div>

I want the script to always remove the text before and after “Seller Refurbished”. I know that “Seller refubished” is a variable that can change.

After sed I want this result:

'Title: Seller refurbished`

Advertisement

Answer

awk '!/</ {print "Title:"$0}' x.txt
Advertisement