You are here: PSPad forum > English discussion forum > How can I search only for odd numbers after the decimal point?

How can I search only for odd numbers after the decimal point?

#1 How can I search only for odd numbers after the decimal point?

Posted by: maki | Date: 2020-04-16 10:53 | IP: IP Logged

How can I search only for odd numbers after the decimal point?

Example:
1,4,7,27,56,78,79,80

Result:
1,7,27,79

Edited 1 time(s). Last edit at 2020-04-16 10:58 by maki.

Options: Reply | Quote | Up ^


#2 Re: How can I search only for odd numbers after the decimal point?

Posted by: pspad | Date: 2020-04-16 11:24 | IP: IP Logged

Somethink like:
\d{0,}[13579]\,
use Copy button

Edited 1 time(s). Last edit at 2020-04-16 11:25 by pspad.

Options: Reply | Quote | Up ^


#3 Re: How can I search only for odd numbers after the decimal point?

Posted by: pspad | Date: 2020-04-16 11:27 | IP: IP Logged

Or use different acces and replace with nothing non odd numbers

Options: Reply | Quote | Up ^


#4 Re: How can I search only for odd numbers after the decimal point?

Posted by: maki | Date: 2020-04-16 12:24 | IP: IP Logged

Still not a perfect regex.

Not correct (not find 79)
11,12,13,79

Correct
11,12,13,79,80

Edited 1 time(s). Last edit at 2020-04-16 12:25 by maki.

Options: Reply | Quote | Up ^


#5 Re: How can I search only for odd numbers after the decimal point?

Posted by: pspad | Date: 2020-04-16 13:11 | IP: IP Logged

Replace end with comma optional with end of line
Such easyb hings you should bd able to do yourself

Options: Reply | Quote | Up ^


#6 Odp: Jak wyszukiwać tylko liczby nieparzyste po przecinku?

Posted by: maki | Date: 2020-04-16 19:57 | IP: IP Logged

I have even more difficult problems to solve, how do I convert decimal numbers to integer numbers?

Example:

===========
11,63513513513514

Convert to:12

If 11.0xx blah blah - 11.49 blah blah
Convert = 11

==========================
If 11.51 blah blah - 11.99xxx blah blah

Convert = 12

So an integer (closest to an integer).

Options: Reply | Quote | Up ^


#7 Re: Odp: Jak wyszukiwać tylko liczby nieparzyste po przecinku?

Posted by: pspad | Date: 2020-04-17 05:48 | IP: IP Logged

Scripting and use ROUND() function
What do you do isn't work for text editor.
Why don't you use some spreadsheet? Excel, OpenOffice, Libre Office...

Options: Reply | Quote | Up ^


#8 Re: Odp: Jak wyszukiwać tylko liczby nieparzyste po przecinku?

Posted by: maki | Date: 2020-04-22 18:56 | IP: IP Logged

I'm not a programmer, and being a programmer is not hip-hop that you will master everything in one day, month, or year.
It's not like this: Do it, do that, search an google forum and you will know how to do it.
These commands tell me nothing and how to use them.
docs.microsoft.com

PSPad has no function: increase every number on the line by +1?

11 to 12
13 to 14
77 to 78

input:
12335,27
12336,17
12337,13
output
12335,28
12336,18
12337,14

Edited 1 time(s). Last edit at 2020-04-22 18:57 by maki.

Options: Reply | Quote | Up ^


#9 Re: Odp: Jak wyszukiwać tylko liczby nieparzyste po przecinku?

Posted by: maki | Date: 2020-04-22 19:05 | IP: IP Logged

How to use Replacement Method in PSPad

Find:
(?=\d)(?:([0-8])(?=.*\1(\d)\d*$)|(?=.*(1)))(?:(9+)(?=.*(~))|)(?!\d)

Replace with: ???????????

Edited 1 time(s). Last edit at 2020-04-22 19:07 by maki.

Options: Reply | Quote | Up ^






Editor PSPad - freeware editor, © 2001 - 2021 Jan Fiala, Hosted by Webhosting TOJEONO.CZ, design by WebDesign PAY & SOFT, code Petr Dvořák, Privacy policy and GDPR