I need to reformat a log file of similar format and have been using Notepad++ macros.
Example:
[00:55:48] Profile Information:
[00:55:48] Name: Joe Bloggs
[00:55:48] Age: 21
[00:55:48] Profile Information:
[00:55:48] Name: Joe Bloggs 2
[00:55:48] Age: 22
I need the format to be:
Joe Bloggs
21
Joe Bloggs 2
22
I can do this with the following operations in a macro but that only gets me so far.
Remove timestamps [[^[]]*]
Remove empty lines Edit > Line Operations > Remove Empty Lines
Replace following with nothing Name: Age:
Then I would need to select every say, 2nd line and remove everything else so I am left with a list of every second line - something like:
21
22
Hoping someone more familiar with Regex and such can chime in with pointers and advice.
I am not sure of what you are asking for. You title is about selecting every 7th line in a textfile but your sample is not related to that.
Anyway, I am guessing that you want to select every 7th line in a text file with notepad++.
You can do something like this:
Remove the empty lines: Edit > Line Operations > Remove Empty Lines
With Search & Replace(on regular expression mode) you can use this expression:
([^\n]*\n?){7}$1P.S. If you want another nth line, just replace the number between the braces.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With