Suppose the data is in following format in a log file.
*******************************************
Refreshing token for app foo1
*******************************************
Refreshing token for app foo2
*******************************************
Refreshing token for app foo3
Update application with name: foo3
Done
Waiting 1 second
*******************************************
This data says that refresh token for foo1 and foo2 is incomplete and refresh token token for foo3 is complete.
I need to separate the apps for which refresh tokens didn't complete.
How to match foo1 and foo2 using vi editor.Any help is appreciated.
if you are using vim, with the file open:
<Esc> To go to command mode
:1 <Enter> to go to line 1
/ Start a search
\d a digit
\n followed by a newline
\* followed by an escaped splat
<Enter> You will be positioned at the first match
n go to the next match
It will look like this at the bottom left:
/\d\n\*
Of course the digit matches your test data, but you'll have to tweak it to match your real data.
This is also working
:set hlsearch
/\*\{30,}\n\s\+Refreshing\stoken\sapp\s\a\a\a\d\n\*\{30,}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.