Home > OS >  A string value for how
A string value for how

Time:09-28

00:02:12 [2019-01-23] productioname. INFO: Response: App \ Third \ API \ common \ Getip; http://192.168.0.1:80/inttest/GetUser? Ipcode=99; {" StatusResult ": 5," UserNum ": 30}

I want to obtain content for

00:02:12 [2019-01-23], 99, 30

Respectively is the beginning of a line of time, the value of the ipcode usernum values
There are tens of thousands of lines of the same format

Think out, each in the awk group together, will become the branch
Only out respectively through excel processing
Here should be how to write, can step in to get me to the field content of

Loop is unlikely to write

CodePudding user response:

Several awk will branch mean? This powerful tool can persist? You write command problem? You air out!!!

CodePudding user response:

Awk '{print $1, $2}' test. TXT & amp; & Awk -f 'ipcode=' {print $2} 'test. TXT | awk -f'; '{print $1}' & amp; & Awk - F '" UserNum ":' '{print $2}' test. TXT | awk -f '} ' '{print $1}
The output into a
[the 2019-01-23 00:02:12]
99
30

I hope it's 00:02:12 [2019-01-23], 99, 30
  • Related