Search text, only in ranges in the line!
-
Hi, I’m procesing text files with notepad++, because I need to correct them!
for example I have this:
19600018444989BERTOLO DANIEL SANDRO B° AGUA Y ENERGIA PLAN 10 M.C 1.0 5515
320551B002600001067001 BVS513REPUESTO CHEVROLET 00000000100000001753700000000000000000000000
320551B0026000010670020584212ACEITE HIDRO(NO SE PROVEE) 00000000150000000103600000000000000000000000
220551B0026000010672707201796000184449890000019091000000000000000000000005400000000100151I want to search lines that start with “196”, only in the first 3 chars.
Any idea?
Best Regards -
Sure, if you do a regular-expression search for
^196
, that should do it. The^
part is what ties it to “start of line”. -
@Scott-Sumner Thanks that works perfect.
Is there any way to also check length of the line: such as “start with 196 and lenght < 89” …Best Regards.
-
One can certainly do that, but how long does this go on? Do I give you that solution and then you add yet another condition to it in a follow-up question? Ideally, you read my response to the first question in this thread and thought, That is really neat. I’ve got to figure out this regular expressons stuff!. And then you go off and do just that, with the various references available on the Internet. And then you are able to solve your own problems along these lines. This is really what I’m encouraging you to do, but I’m not opposed to helping you out on your current problem, if you are in a hurry to get wherever it is you are going. :-D
So I might solve your new problem this way:
Find-what zone:
(?-s)^196.{0,85}$
Basically what this does is say that after the
196
at the start of the line, there needs to be from zero to 85 other characters before the end-of-line is seen to have a match–anything else (e.g., a longer line than 88 total characters) will not be matched. -
@Scott-Sumner You are totally right, reg expression are still a mystery for me. I use it in a dummy way, chek email format, numbers. But to me is a pending issue. Thank you very much, you gave me more than I expect.