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

Answer by αғsнιη for Extracting String between given token

Using grep as you mentioned you "have %string% simply present":grep -o '%[^%]*%' infile

View Article



Answer by okcomputer_kid for Extracting String between given token

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...

View Article

Answer by Kartik Sabharwal for Extracting String between given token

If all the lines in the file will be structured like the example, I believe you can use the command line program cut to treat the percent signs as field delimiters and pick the 2nd and 4th fields. So...

View Article

Extracting String between given token

I want to extract string between given token from a file, in my case it is between %. I have highlighted the strings in Bold below.Content:Update DIMENSIONPARAMETER set...

View Article
Browsing all 4 articles
Browse latest View live




Latest Images