how to extract?
-
Friends I need your help, how can I select only the lines that have only PACKS_2?
areaCode = 343 | PHONE = 4270 | Tipo_idx = 4 | DOC = 12313SA | ID2 = 1066 | PACKS_1 = [40|JOURNAL] | PACKS_2 = []
areaCode = 343 | PHONE = 42410 | Tipo_idx = 4 | DOC = 12313ZAS | ID2 = 10 | PACKS_2 = []
ID = 1836854 | areaCode = 341 | PHONE = 4973 | PACKS_2 = []
areaCode = 23 | PHONE = 466 | Tipo_idx = 1 | DOC = 2705 | ID2 = 12105 | PACKS_1 = [40|ClásiCS | PACKS_2 = []
areaCode = 11 | PHONE = 34484555 | Tipo_idx = 4 | DOC = 31184 | PACKS_2 = []
ID = 7863 | areaCode = 11 | PHONE = 5387 | Tipo_idx = 4 | DOC = 92651 | PACKS_2 = []to
areaCode = 343 | PHONE = 42410 | Tipo_idx = 4 | DOC = 12313ZAS | ID2 = 10 | PACKS_2 = []
ID = 1836854 | areaCode = 341 | PHONE = 4973 | PACKS_2 = []
areaCode = 11 | PHONE = 34484555 | Tipo_idx = 4 | DOC = 31184 | PACKS_2 = []
ID = 7863 | areaCode = 11 | PHONE = 5387 | Tipo_idx = 4 | DOC = 92651 | PACKS_2 = [] -
follow these steps:
1 - press ctrl + H.
2 - press ‘mark’ botton.
3 - in ‘find what’, type ‘packs_2’.
4 - turn on ‘bookmark line’ and ‘normal’ in search mode.
5 - press ‘mark all’ and then ‘close’.
6 - press alt + s.
7 - press ‘bookmark’ bottom.
8 - press ‘remove unmarked lines’
that’s all. -
@alimirzaei5778
could be done with regular expressions
? -
@zarate-petery said in how to extract?:
could be done with regular expressions
You didn’t specify a problem that requires regular expressions to solve…
-
@zarate-petery said in how to extract?:
how can I select only the lines that have only PACKS_2?
All 6 lines of sample input contain PACKS_2 and other text. So none contain “only PACKS_2”.
Your sample output helps, but not completely. Did you mean “lines that don’t contain PACKS_1” or “lines that don’t contain PACKS_<anything besides 2>” or what?
-
@neil-schipper
lines that do not contain PACKS_1 and only the lines that contain PACKS_2 = [] remain -
As a starting point, this regex matches all complete lines that do contain PACKS_1:
^.*?PACKS_1.*?$\R
You can use it in a Replace All operation with Replace field completely empty; this would delete all these lines.
This would meet the overall need with your sample data, but possibly not all of your real world data.