Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

sed issue - Extract specific words from file

Tags:

regex

linux

sed

I would like to get some help with SED.

I'm trying to extract some files from a file, all the words that I need start like this.

39;,bugs.pr~%3D~'TEXT23

I need to get TEXT23 for example.

What I did what, first, change 39;,bugs.pr~%3D~' for IDEX which is my flag, then seach for IDEX and extract 8 characters from that word.

like image 402
Kram Avatar asked Jan 23 '26 13:01

Kram


1 Answers

The following sed command might eliminate all text but what you want.

sed 's/^39;,bugs.pr~%3D~'//p;d' file
like image 132
potong Avatar answered Jan 25 '26 11:01

potong