How do I use grep to extract a specific field value from lines -


I have rows in a file that look like the following

  ... .. displayName = "john" ..........  

where .... displays the variable number of other fields is.

Using the following grep command, I am able to remove all lines containing a valid 'DisplayName' field

  grep DisplayName = "[0-9A-Za- However, I want to extract just the name (i.e. "John") from each row instead of the whole line which comes back by I Grep I tried to pipeline the output in cut command but it does not accept string delimiter .   

Special By:

  sed 's /. DisplayName = "\ (. * \)". * / / 1 /'  

But the semantiutethesis / advance / where "/" is the delimiter is used to keep the part of the pattern specified by the parentheses in parentheses in combination with escape 1, this expression displays inside each bracket and the rest

This can work without first using grep, if you use:

  Sed -n 's /.* DisplayName = "\ (. 

in excess:


Comments