Help with formula
How do i search for “log” and “quantity” then replace the numbers after it…
…contents log quantity 76 lastaccessed 2323.00 end
…contents log quantity 344 lastaccessed 7854.00 end
Chane the numbers (76, 344) to say (1000) but NOT change anything else (the file has a lot of other info.
You know something like
Log quantity +./k (?=lastaccess)
Its something like that…but im not sure???
Does anyone know about that…or even a different way to change those amounts only…i have other amounts of other things in the file, so it must change logs only nothing else
Ok nevermind…i recalled what guy038 said about the subject and figured out what i needed thanks anyway…and if you read this guy038, thanks.
guy038 last edited by
If there’s only ONE string log quantity ( or zero, of course ), in each line of your file, with only ONE space, between the two words, I think that two solutions are possible :
(?<=log quantity ) *\d+and REPLACE =
1000with a SPACE, before and after the ending round bracket
log quantity \K *\d+and REPLACE =
1000with a SPACE, after the word quantity and after the syntax \K
In the first regex, we look for a possible range of spaces (
*), followed by a non empty range of digits, ONLY IF it is preceded with the string "log quantity "
In the second regex, we, first, try to match the string "log quantity " and, due to the
\Ksyntax, the regex engine restart the search process. So, we, finally, looks, as before, for a possible range of spaces (
*), followed by a non empty range of digits
Due to the
\Ksyntax or the
(?<=log quantity )look-behind, this S/R does NOT work, if you click, several times, on the Replace button, for step by step replacement
You need to us, exclusively, the buttons Replace All or Replace All in All Opened Documents, of the Replace dialog
If the words log and quantity may be separated by an arbitrary number of spaces, the first regex must NOT be used. Indeed, the syntax
(?<=log +quantity ) *\d+is an invalid regular expression, because the expression log +quantity is NOT a fixed length string, inside a look-behind !
On the contrary, the regex
log +quantity \K *\d+is a correct regular expression :-))
ok I’m getting flagged as spam (not sure why) so I’m going to try to post this…
I need to add in two lines of text
after the line:
and before the line
do you know how to add in the two last lines
note: they should be indented