Quantcast
Channel: Extracting String between given token - Ask Ubuntu
Viewing all articles
Browse latest Browse all 4

Answer by okcomputer_kid for Extracting String between given token

$
0
0

Try this.

sed -r 's/[^%]*%([^%]*)%\S*(\s)*/\1\2/g'

Its easy to extract for single occurence using sed. For multiple occurences, I had found something like this before for similar problem. I couldn't find that thread.

Okay, this detects first occurence correctly but not second occurence. Won't work.

Karthik's answer works perfect!


Viewing all articles
Browse latest Browse all 4

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>