I need to get the value after specific word

user400006

I need to get the value of "name" from this line

"snapshots": [{"name":"sLVZt","user":"comment","current":"n","created":"2015-03-11 05:28:02"},{"name":"ubg9x","user":"test2",{"name":"lo3Qp","user":"test3","current":"y","created":"2015-03-11 06:02:46"}]}

I expect the output to be like this

sLVZt
ubg9x
lo3Qp
terdon

If you're on Linux or otherwise have access to GNU grep, you can do:

$ grep -oP '"name":"\K[^"]+' file 
sLVZt
ubg9x
lo3Qp

Alternatively, in Perl:

$ perl -lne 'print join "\n", /"name":"([^"]+)/g' file 
sLVZt
ubg9x
lo3Qp

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

get value after specific word

I need to extract a specific word after a word using regex

get multiple occurance of a value after a specific word with regex

I need to get the values that have a specific result on .value_counts()

Javascript : Get word after specific word?

Get the first word after specific word in a column

How to make a condition that if a value (that is a character) starts with a specific word, then I need to print a vector?

Get everything after specific word and before specific word in PHP

Trying to get a specific word and the word after/before said word in a string

Get Text after word at specific position

Regex to get the word after specific match words

Get all words that come after specific word

Need Help In Regular Expression - Match 6 digits after specific word

need to get a subsequent record with a specific value

After REST API call ,i have key/value pair in the below format ,I Need to extract just the specific value corresponding to the key

How can I get only the line for the first occurrence of a word after a specific line in Python?

I need to pick a specific value from an array

Given a word, I need to get all variations of spaces for that word

How to get lines after the word match and before other specific word?

java regex get value after specific value

Get value of cell after a row with specific value

How can I get the word after a string?

In Word 2013 do I need Section Breaks before and after section?

I need to get name and count value in table

I need to Set Value the get URL in a cell

I need to highlight word by word

Use BeautifulSoup to get a value after a specific tag

How to get specific value after parsing an XML?

Get value after and before specific character