You are here: PSPad forum > English discussion forum > Where is the simple option: "Reverse"?

Where is the simple option: "Reverse"?

Goto Page: 1 2 3 Next

#1 Where is the simple option: "Reverse"?

Posted by: maki | Date: 2019-06-17 14:08 | IP: IP Logged

Where is the simple option: "Reverse"?

Example: 01,56,79 -> 79,56,01

Edited 1 time(s). Last edit at 2019-06-17 14:09 by maki.

Options: Reply | Quote | Up ^


#2 Re: Where is the simple option: "Reverse"?

Posted by: pspad | Date: 2019-06-17 14:30 | IP: IP Logged

Sorry, but it isn't reverze.
Reverse is: 01,56,79 -> 97,65,10

If you want to take list of values, delimited by some char and create reverse order of values, write script for it.
Of if number of values is constant and limited e.g. by 9, you can use regular expressions.

Options: Reply | Quote | Up ^


#3 Re: Where is the simple option: "Reverse"?

Posted by: maki | Date: 2019-06-17 18:26 | IP: IP Logged

But I'm not a scriptwriter or programmer.

Reverses every number, which is completely wrong!

image

Edited 1 time(s). Last edit at 2019-06-17 18:33 by maki.

Options: Reply | Quote | Up ^


#4 Re: Where is the simple option: "Reverse"?

Posted by: pspad | Date: 2019-06-17 18:48 | IP: IP Logged

First step: you need to make a list delimited strings
Second step: you will reverse strings order
Third step: you will create delimited list of strings

Why don't you use regular expressions? You can use user
convertors to create one click reverse string without programming knowledges

Edited 1 time(s). Last edit at 2019-06-17 18:49 by pspad.

Options: Reply | Quote | Up ^


#5 Re: Where is the simple option: "Reverse"?

Posted by: maki | Date: 2019-06-17 22:49 | IP: IP Logged

It's just that it does not work for me:

^([^,]*)\,(\d+)$

Options: Reply | Quote | Up ^


#6 Re: Where is the simple option: "Reverse"?

Posted by: pspad | Date: 2019-06-18 02:49 | IP: IP Logged

(\d+), (\d+),(\d+),(\d+)
$4,$3,$2,$1

Options: Reply | Quote | Up ^


#7 Re: Where is the simple option: "Reverse"?

Posted by: Stefan | Date: 2019-06-19 08:28 | IP: IP Logged

FROM:
01,56,79
TO:
79,56,01

USE:
Ctrl+H
Search: (\d\d),(\d\d),(\d\d)
Replace: $3,$2,$1
[x]RegEx

--
Stefan (pleased user since 1722)
Do you know you can spend Jan a beer? (click here)
Inofficial FAQs + Infos + Special Settings

Options: Reply | Quote | Up ^


#8 Re: Where is the simple option: "Reverse"?

Posted by: maki | Date: 2019-06-21 07:25 | IP: IP Logged

pspad:
(\d+), (\d+),(\d+),(\d+)
$4,$3,$2,$1

But it works only with a defined set of numbers. It will not work for a different set. It does not look good if I had to modify it every time. Still need to improve it so that it can work on every set of numbers.

Options: Reply | Quote | Up ^


#9 Re: Where is the simple option: "Reverse"?

Posted by: pspad | Date: 2019-06-21 11:19 | IP: IP Logged

maki:
But it works only with a defined set of numbers. It will not work for a different set. It does not look good if I had to modify it every time. Still need to improve it so that it can work on every set of numbers.

You can use user convertors and define several convertors for different numbers.
Or you can try to write own script. I wrote you steps you need to do in the script

Options: Reply | Quote | Up ^


#10 Re: Where is the simple option: "Reverse"?

Posted by: maki | Date: 2019-06-21 11:37 | IP: IP Logged

You can always find scripts on the programming page, but first you need to know how to use, for example, java script, c++, or many more. In my life I wrote only a few simple scripts, and I do not have too extensive knowledge on this subject.

#include <stdio.h>
int main()
{
int n, reversedNumber = 0, remainder;

printf("Enter an integer: ");
scanf("%d", &n);

while(n != 0)
{
remainder = n%10;
reversedNumber = reversedNumber*10 + remainder;
n /= 10;
}

printf("Reversed Number = %d", reversedNumber);

return 0;
}

Options: Reply | Quote | Up ^


Goto Page: 1 2 3 Next





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