Hello,
I have a problem with sorting numbers
I have a lot of numbers like this
SIG TS 5843
SIG TS 61
SIG TS 793
SIG TS 8603
SIG TS 870
I cannot get them in the right order
Is there a way to add '00' or '000' to numbers
that the program can see TS 870 needs two zero's
and TS 87 needs thee zero's?
Thanks in advance
Jan
sorting numbers and adding zero's to numbers
Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard
-
ben_josephs
- Posts: 2464
- Joined: Sun Mar 02, 2003 9:22 pm
You can sort them in TextPad as they are with a key From column 8, by Numeric comparison.
You get all the numbers to be 5 digits long in steps in a variety of ways, including this:
You get all the numbers to be 5 digits long in steps in a variety of ways, including this:
Find what: \<[0-9]\>
Replace with: 0000\0
Find what: \<[0-9]{2}\>
Replace with: 000\0
Find what: \<[0-9]{3}\>
Replace with: 00\0
Find what: \<[0-9]{4}\>
Replace with: 0\0
sorting numbers
Hello ben-josephs,
Thanks for your reaction
I do not understand "From column 8, by Numeric comparison"
is that a key in textpad?
do I need regular expression?
Is it possibile to use this command in files, because te numbers are in text files:
\DAT 13-11-00
\DAV 20001113
\SIG TS 8602 [K170B]
\EXU g
Is it possible to add the TS to the command so that only the numbers with TS are changed?
Jan
Thanks for your reaction
I do not understand "From column 8, by Numeric comparison"
is that a key in textpad?
do I need regular expression?
Is it possibile to use this command in files, because te numbers are in text files:
\DAT 13-11-00
\DAV 20001113
\SIG TS 8602 [K170B]
\EXU g
Is it possible to add the TS to the command so that only the numbers with TS are changed?
Jan
-
ben_josephs
- Posts: 2464
- Joined: Sun Mar 02, 2003 9:22 pm
You said you wanted to sort them. You can do that in TextPad with
Tools | Sort... (or <F9>).
There you will find the settings I suggested.
You can restrict the searches above to lines in which the number is prefixed by TS like this:
This assumes you are using Posix regular expression syntax:
Tools | Sort... (or <F9>).
There you will find the settings I suggested.
You can restrict the searches above to lines in which the number is prefixed by TS like this:
etc.Find what: TS ([0-9]{2})\>
Replace with: TS 000\1
This assumes you are using Posix regular expression syntax:
Configure | Preferences | Editor
[X] Use POSIX regular expression syntax
sorting numbers
Hi ben_josehps
Yes I said I wanted to sort them, but did'nt tell you that the numbers where in a file with a lot of tekst.....sory..
This command TS \<[0-9]\>
finds
TS 8
and the replace is
000TS 8
In stead of TS 00008
The command TS \<[0-9]{2}\>
does not work, I think because of
the { } ?
Jan
Yes I said I wanted to sort them, but did'nt tell you that the numbers where in a file with a lot of tekst.....sory..
This command TS \<[0-9]\>
finds
TS 8
and the replace is
000TS 8
In stead of TS 00008
The command TS \<[0-9]{2}\>
does not work, I think because of
the { } ?
Jan
-
ben_josephs
- Posts: 2464
- Joined: Sun Mar 02, 2003 9:22 pm