Re: [libreoffice-users] Writer- find and replace a number
Didn't specify if number meant just digits, so did test with [[:digit:]\|"$"\"."\","] That replaces digits and "$.,", but would replace them appearing elsewhere as well. Might also add "+-" as well. Also, in my test made font a mono font, since replacing digits with spaces would shift alignment. An example of the data might have been useful to come with a more complete answer. On 30 Jun 2023 at 17:54, . wrote: Date sent: Fri, 30 Jun 2023 17:54:26 -0400 Subject:Re: [libreoffice-users] Writer- find and replace a number To: Eyal Rozenberg , users@global.libreoffice.org From: "." > Perfect! Thank you! > > Peter > > *From:* Eyal Rozenberg [mailto:eyalr...@gmx.com] > *Subject:* [libreoffice-users] Writer- find and replace a number > *Date:* Friday, June 30, 2023 at 5:50 PM > *To:* users@global.libreoffice.org, . > > > 1. Open the "Find and Replace" dialog (e.g. with Ctrl+H). > > 2. Check the "Regular Expressions" checkbox in the lower part of the > > dialog > > 3. Enter a regular expression which will match numbers: [0-9]+ (with > > the plus sign!). > > 4. Enter the replacement text you want (you can use $1 in the > > replacement string to get the number that was matched) > > 5. Press "Find Next" and then possibly "Replace" or "Replace All" as > > appropriate > > > > What does the regexp mean? It means "One or more occurrences of a > > character from the sequence 0-9". For more about regular expressions, > > see for example: https://www.sitepoint.com/learn-regex/ > > > > Hope that helped, > > Eyal > > > > > > On 01/07/2023 0:26, . wrote: > >> How do I find and replace all numbers in Writer? > >> > >> What I'm trying to do is get rid of the numbers in a list. > >> > >> I have NO idea what they're talking about "regular expressions" and > >> can't figure out a wild card for numbers. > >> > >> Any ideas? > >> > >> > >> Thanks, > >> > >> Peter > >> > >> > > > -- > To unsubscribe e-mail to: users+unsubscr...@global.libreoffice.org > Problems? > https://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/ > Posting guidelines + more: https://wiki.documentfoundation.org/Netiquette > List archive: https://listarchives.libreoffice.org/global/users/ > Privacy Policy: https://www.documentfoundation.org/privacy ++ Michael D. Setzer II - Computer Science Instructor (Retired) mailto:mi...@guam.net mailto:msetze...@gmail.com Guam - Where America's Day Begins G4L Disk Imaging Project maintainer http://sourceforge.net/projects/g4l/ ++ -- To unsubscribe e-mail to: users+unsubscr...@global.libreoffice.org Problems? https://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/ Posting guidelines + more: https://wiki.documentfoundation.org/Netiquette List archive: https://listarchives.libreoffice.org/global/users/ Privacy Policy: https://www.documentfoundation.org/privacy
Re: [libreoffice-users] Writer- find and replace a number
p.s. I've just seen Eyal Rozenberg's answer which is quite similar. Aside from [0-9]+ vs [:digit:] there is one significant difference, the "+" at the end. Using Eyal's method any consecutive string of digits is replaced with whatever is in "Replace:". Using the method I offered each individual digit is replaced by what is in the "Replace:" field. That is not because of [0-9] vs [:digit:] but because of the "+". Pick whichever meets your needs best. On Fri, Jun 30, 2023 at 6:04 PM Alan B wrote: > Regular expressions (regex) are a challenge to get your mind around. Your > need seems to be straight forward so there's not a lot to absorb to use > regex for this case. > > Open the "Find & Replace" dialog. > > In the "Find:" field enter "[:digit:]" without the quotes. > > In the "Replace:" field put whatever you'd like to replace EACH digit with. > > Tick "Regular expressions" in "Other options". > > The regex given will find each individual digit no matter what it is and > replace it with whatever is in the "Replace:" field. > > In essence, it is giving that wildcard you want for numbers. > > If you want to experiment some with regex, branching out from the above, > check the LO regular expression webpage. > https://help.libreoffice.org/6.2/en-US/text/shared/01/0211.html > > I hope this is what you are looking for. > > On Fri, Jun 30, 2023 at 5:27 PM . wrote: > >> How do I find and replace all numbers in Writer? >> >> What I'm trying to do is get rid of the numbers in a list. >> >> I have NO idea what they're talking about "regular expressions" and >> can't figure out a wild card for numbers. >> >> Any ideas? >> >> >> Thanks, >> >> Peter >> >> >> -- >> To unsubscribe e-mail to: users+unsubscr...@global.libreoffice.org >> Problems? >> https://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/ >> Posting guidelines + more: https://wiki.documentfoundation.org/Netiquette >> List archive: https://listarchives.libreoffice.org/global/users/ >> Privacy Policy: https://www.documentfoundation.org/privacy >> > > > -- > Alan Boba > CISSP, CCENT, ITIL v3 Foundations 2011 > > -- Alan Boba CISSP, CCENT, ITIL v3 Foundations 2011 -- To unsubscribe e-mail to: users+unsubscr...@global.libreoffice.org Problems? https://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/ Posting guidelines + more: https://wiki.documentfoundation.org/Netiquette List archive: https://listarchives.libreoffice.org/global/users/ Privacy Policy: https://www.documentfoundation.org/privacy
Re: [libreoffice-users] Writer- find and replace a number
Regular expressions (regex) are a challenge to get your mind around. Your need seems to be straight forward so there's not a lot to absorb to use regex for this case. Open the "Find & Replace" dialog. In the "Find:" field enter "[:digit:]" without the quotes. In the "Replace:" field put whatever you'd like to replace EACH digit with. Tick "Regular expressions" in "Other options". The regex given will find each individual digit no matter what it is and replace it with whatever is in the "Replace:" field. In essence, it is giving that wildcard you want for numbers. If you want to experiment some with regex, branching out from the above, check the LO regular expression webpage. https://help.libreoffice.org/6.2/en-US/text/shared/01/0211.html I hope this is what you are looking for. On Fri, Jun 30, 2023 at 5:27 PM . wrote: > How do I find and replace all numbers in Writer? > > What I'm trying to do is get rid of the numbers in a list. > > I have NO idea what they're talking about "regular expressions" and > can't figure out a wild card for numbers. > > Any ideas? > > > Thanks, > > Peter > > > -- > To unsubscribe e-mail to: users+unsubscr...@global.libreoffice.org > Problems? > https://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/ > Posting guidelines + more: https://wiki.documentfoundation.org/Netiquette > List archive: https://listarchives.libreoffice.org/global/users/ > Privacy Policy: https://www.documentfoundation.org/privacy > -- Alan Boba CISSP, CCENT, ITIL v3 Foundations 2011 -- To unsubscribe e-mail to: users+unsubscr...@global.libreoffice.org Problems? https://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/ Posting guidelines + more: https://wiki.documentfoundation.org/Netiquette List archive: https://listarchives.libreoffice.org/global/users/ Privacy Policy: https://www.documentfoundation.org/privacy
Re: [libreoffice-users] Writer- find and replace a number
Perfect! Thank you! Peter *From:* Eyal Rozenberg [mailto:eyalr...@gmx.com] *Subject:* [libreoffice-users] Writer- find and replace a number *Date:* Friday, June 30, 2023 at 5:50 PM *To:* users@global.libreoffice.org, . 1. Open the "Find and Replace" dialog (e.g. with Ctrl+H). 2. Check the "Regular Expressions" checkbox in the lower part of the dialog 3. Enter a regular expression which will match numbers: [0-9]+ (with the plus sign!). 4. Enter the replacement text you want (you can use $1 in the replacement string to get the number that was matched) 5. Press "Find Next" and then possibly "Replace" or "Replace All" as appropriate What does the regexp mean? It means "One or more occurrences of a character from the sequence 0-9". For more about regular expressions, see for example: https://www.sitepoint.com/learn-regex/ Hope that helped, Eyal On 01/07/2023 0:26, . wrote: How do I find and replace all numbers in Writer? What I'm trying to do is get rid of the numbers in a list. I have NO idea what they're talking about "regular expressions" and can't figure out a wild card for numbers. Any ideas? Thanks, Peter -- To unsubscribe e-mail to: users+unsubscr...@global.libreoffice.org Problems? https://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/ Posting guidelines + more: https://wiki.documentfoundation.org/Netiquette List archive: https://listarchives.libreoffice.org/global/users/ Privacy Policy: https://www.documentfoundation.org/privacy
Re: [libreoffice-users] Writer- find and replace a number
1. Open the "Find and Replace" dialog (e.g. with Ctrl+H). 2. Check the "Regular Expressions" checkbox in the lower part of the dialog 3. Enter a regular expression which will match numbers: [0-9]+ (with the plus sign!). 4. Enter the replacement text you want (you can use $1 in the replacement string to get the number that was matched) 5. Press "Find Next" and then possibly "Replace" or "Replace All" as appropriate What does the regexp mean? It means "One or more occurrences of a character from the sequence 0-9". For more about regular expressions, see for example: https://www.sitepoint.com/learn-regex/ Hope that helped, Eyal On 01/07/2023 0:26, . wrote: How do I find and replace all numbers in Writer? What I'm trying to do is get rid of the numbers in a list. I have NO idea what they're talking about "regular expressions" and can't figure out a wild card for numbers. Any ideas? Thanks, Peter -- To unsubscribe e-mail to: users+unsubscr...@global.libreoffice.org Problems? https://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/ Posting guidelines + more: https://wiki.documentfoundation.org/Netiquette List archive: https://listarchives.libreoffice.org/global/users/ Privacy Policy: https://www.documentfoundation.org/privacy
[libreoffice-users] Writer- find and replace a number
How do I find and replace all numbers in Writer? What I'm trying to do is get rid of the numbers in a list. I have NO idea what they're talking about "regular expressions" and can't figure out a wild card for numbers. Any ideas? Thanks, Peter -- To unsubscribe e-mail to: users+unsubscr...@global.libreoffice.org Problems? https://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/ Posting guidelines + more: https://wiki.documentfoundation.org/Netiquette List archive: https://listarchives.libreoffice.org/global/users/ Privacy Policy: https://www.documentfoundation.org/privacy