I need to delete anything before ANY number, AND the number in a line
-
I need to make this:
Cobrança recebida - fatura nr. 183893434 JOÃO FLORES
Taxa de boleto - fatura nr. 183893434 JOÃO FLORES
Desconto na tarifa - fatura nr. 183893434 JOÃO FLORES
Cobrança recebida - fatura nr. 184029355 JOÃO FLORES
Taxa do Pix - fatura nr. 184029355 JOÃO FLORES
Desconto na tarifa - fatura nr. 184029355 JOÃO FLORES
Cobrança recebida - fatura nr. 184569951 Proredes Int C E Servicos De Inf
Transação via Pix com chave para PRO INT SER DE INF
Cobrança recebida - fatura nr. 185197278 RUDNALDO FERNANDES DIAS DA SILVA
Taxa de boleto - fatura nr. 185197278 RUDNALDO FERNANDES DIAS DA SILVA
Desconto na tarifa - fatura nr. 185197278 RUDNALDO FERNANDES DIAS DA SILVABecoming this:
JOÃO FLORES
JOÃO FLORES
JOÃO FLORES
JOÃO FLORES
JOÃO FLORES
JOÃO FLORES
Proredes Int C E Servicos De Inf
PRO INT SER DE INF
RUDNALDO FERNANDES DIAS DA SILVA
RUDNALDO FERNANDES DIAS DA SILVA
RUDNALDO FERNANDES DIAS DA SILVAI guess if I manage to remove everything before numbers in a line AND remove the numbers aswell, it will solve 99,99% of my problem. For every 1000 lines there only one wont have that pattern with the numbers. This one will get highlighted in the dynamic sheet mounted with these data in a Google Sheet. I can fix that black sheep manually easypeasy.
-
Hello, @greg-greg and All,
Seemingly, you would like to delete from beginning of any line till the string
fatura nr.
followed with a number and aspace
character !However, in the line
Transação via Pix com chave para PRO INT SER DE INF
, the stringfatura nr.
does not occur. In that case, I supposed that you wanted to delete from beginning of line till the wordpara
. Not totally sure about that !Thus, use the regex S/R :
SEARCH
(?-is)^.+ fatura nr\. \d+ (.+)|^.+ para (.+)
REPLACE
\1\2
Best Regards
guy038
-
@greg-greg said in I need to delete anything before ANY number, AND the number in a line:
I guess if I manage to remove everything before numbers in a line AND remove the numbers aswell, it will solve 99,99% of my problem.
As your request was really only to solve the 99.99% of the problem and you didn’t elaborate on the lines without numbers, I figured on solving your request in a different way to @guy038. I also think mine will help with the remaining 0.01% as well.
- Mark all lines that have no numbers in them at all, this was what you stated those 0.01% of lines do have in common. The regex to use (in the Mark function) is
(?-s)^[^\d]+$
and click “bookmark line” so those lines will be marked with a blue sphere in the left margin. These lines won’t be changed by step #2 so need checking afterwards in step #3. - To remove the portion of each line with a number run this regex on the whole document. Find What:
(?-s).+\d+\s
, Replace field to be empty. Click Replace all and that will remove all text up to and including the (single group of) numbers and a following space. - In step #1 you marked the lines without numbers. You can now move through those lines using F2 (forwards) and Shift-F2 (backwards) to complete the edits. The “marking” process makes it easier to find the remaining lines to be edited.
Terry
- Mark all lines that have no numbers in them at all, this was what you stated those 0.01% of lines do have in common. The regex to use (in the Mark function) is
-
@guy038 thanks for the reply, I ended up using the solution from Terry coz I tried it first and it worked just fine hehe
-
@Terry-R thanks Terry, I didnt even bothered to do it all, I just searched for (?-s).+\d+\s and replaced with nothing. worked like a charm, no backfiring at all, not even those 0,01% I was expecting to have.