You are here: PSPad forum > English discussion forum > NUMBERING

NUMBERING

Goto Page: 1 2 Next

#1 NUMBERING

Posted by: garydavid711 | Date: 2013-12-31 17:54 | IP: IP Logged

I have a large text I would like to number 1-2-is their a fast way?
example
aaaaaaaaaaaaaaaaaaaaaaaaaa
bbbbbbbbbbbbbbbbbbbbbbbbbb
cccccccccccccccccccccccccc
dddddddddddddddddddddddddd
eeeeeeeeeeeeeeeeeeeeeeeeee
ffffffffffffffffffffffffff
gggggggggggggggggggggggggg
hhhhhhhhhhhhhhhhhhhhhhhhhh
to:
1aaaaaaaaaaaaaaaaaaaaaaaaa
2bbbbbbbbbbbbbbbbbbbbbbbbb
1ccccccccccccccccccccccccc
2ddddddddddddddddddddddddd
1eeeeeeeeeeeeeeeeeeeeeeeee
2fffffffffffffffffffffffff
1ggggggggggggggggggggggggg
2hhhhhhhhhhhhhhhhhhhhhhhhh

Options: Reply | Quote | Up ^


#2 Re: NUMBERING

Posted by: pspad | Date: 2013-12-31 18:33 | IP: IP Logged

The easiest way is shimple script using PSPad scripting.
In script subfolder is readme file with example how to go through lines in file.

Options: Reply | Quote | Up ^


#3 Re: NUMBERING

Posted by: garydavid711 | Date: 2014-01-01 20:54 | IP: IP Logged

I looked all over my PSPAD and saw nothing on scripting?

Options: Reply | Quote | Up ^


#4 Re: NUMBERING

Posted by: vbr | Date: 2014-01-01 23:58 | IP: IP Logged

garydavid711:
I looked all over my PSPAD and saw nothing on scripting?

Hi,
check the reference file for scripting:
...\PSPad\Script\ReadMe.rtf

Alternatively, i believe, you can get the desired numbering with a simple macro:
Go to:
Tools: Macro: Start/Stop recording (Ctrl+F5)
and perform to following steps (key presses):

[Home]1[DownArrow][Home]2[DownArrow][Home]

Then press Ctrl+F5 again and enter the macro name like number_lines_1_2

Then go to
Tools: Macro: Macro manager
select number_lines_1_2 and click play x times
and set the appropriate number depending on the number of lines.

If you set more macro runs than necessary, you will have to just delete the extra numbers at the beginning of the last line.

hth
vbr

Options: Reply | Quote | Up ^


#5 Re: NUMBERING

Posted by: garydavid711 | Date: 2014-01-02 22:59 | IP: IP Logged

THANK YOU SO MUCH! Now I want to seperate all the 1's from 2's
I entered Ctrl F---- ^\2
REGEX---copy non matching---copy
DID NOT SEPARATE? What am i missing?

Options: Reply | Quote | Up ^


#6 Re: NUMBERING

Posted by: vbr | Date: 2014-01-02 23:51 | IP: IP Logged

garydavid711:
THANK YOU SO MUCH! Now I want to seperate all the 1's from 2's
I entered Ctrl F---- ^\2
REGEX---copy non matching---copy
DID NOT SEPARATE? What am i missing?

Do you need have the odd lines and the even lines each in separate texts?
The Copy function of the search dialog should do it;
just check [x] regex (and uncheck "copy not maching..."
and use e.g. the following patterns for lines with starting numbers - 1 or 2 respecitvely
^1.*

^2.*

the "List" function should produce the separate results lists

Or do you intend to just insert an empty line between the lines in the current file or some other mode of separating?

hth,
vbr

Options: Reply | Quote | Up ^


#7 Re: NUMBERING

Posted by: garydavid711 | Date: 2014-01-03 01:42 | IP: IP Logged

i want all the 1 in a list

i put in find ^1.*

check regex

clicked list nothing generated

clicked copy nothing happen?

i un check copy non matching

i missing something -not generating anything

Options: Reply | Quote | Up ^


#8 Re: NUMBERING

Posted by: vbr | Date: 2014-01-03 10:15 | IP: IP Logged

garydavid711:
i want all the 1 in a list
i put in find ^1.*
check regex
clicked list nothing generated
clicked copy nothing happen?
i un check copy non matching
i missing something -not generating anything

Sorry for the mistake, you would indeed use "Copy" instead of "List" I mentioned previously.

The search as well as "Copy" runs from the cursor position be default; you need to place the cursor at the beginning of the file before running copy ^1.*
(Alternatively, you can set Direction: (o) "Entire scope" instead)

After that, it should work;
are the numbers really at the very beginning of the lines? (e.g. if there were some extra spaces, the pattern should be adjusted.

hth,
vbr

Options: Reply | Quote | Up ^


#9 Re: NUMBERING

Posted by: garydavid711 | Date: 2014-01-03 16:05 | IP: IP Logged

i am doing everything you say but does not work -the numbers are at beginning of line and i put cursor blink at beginning--i can change the numbers to anything i want to but i do not see how this makes a difference?

1.Ze se'fer tol'dot ha'Ma'shi'ach Yeshua ben-David ben-Avraham
2.The book of the generation of Jesus Christ the son of David the son of Abraham
1.Av'ra'ham ho'lid et-Yitzchak ve'Yitzchak ho'lid et-Yaakov ve'Yaakov ho'lid et-Yehooda ve'et-echav
2.Abraham begat Isaac and Isaac begat Jacob and Jacob begat Judas and his brethren
1.Vi'Y'hoo'da ho'lid et-Pe'retz ve'et-Ze'rach mi'Tamar oo'Fe'retz ho'lid et-Chetz'ron ve'Chetz'ron ho'lid et-Ram
2.And Judas begat Phares and Zara of Thamar and Phares begat Esrom and Esrom begat Aram
1.Ve'Ram ho'lid et-Ami'na'dav ve'Ami'na'dav ho'lid et-Nach'shon ve'Nach'shon ho'lid et-Salmon
2.And Aram begat Aminadab and Aminadab begat Naasson and Naasson begat Salmon
1.Ve'Salmon ho'lid et-Boaz me'Ra'chav oo'Voaz ho'lid et-O'ved me'Root ve'O'ved ho'lid et-Yi'shai
2.And Salmon begat Booz of Rachab and Booz begat Obed of Ruth and Obed begat Jesse

Options: Reply | Quote | Up ^


#10 Re: NUMBERING

Posted by: Stefan | Date: 2014-01-03 19:17 | IP: IP Logged

It works for me:

1) Having your text as example:

garydavid711:
1.Ze se'fer tol'dot ha'Ma'shi'ach Yeshua ben-David ben-Avraham
2.The book of the generation of Jesus Christ the son of David the son of Abraham
1.Av'ra'ham ho'lid et-Yitzchak ve'Yitzchak ho'lid et-Yaakov ve'Yaakov ho'lid et-Yehooda ve'et-echav
2.Abraham begat Isaac and Isaac begat Jacob and Jacob begat Judas and his brethren
1.Vi'Y'hoo'da ho'lid et-Pe'retz ve'et-Ze'rach mi'Tamar oo'Fe'retz ho'lid et-Chetz'ron ve'Chetz'ron ho'lid et-Ram
2.And Judas begat Phares and Zara of Thamar and Phares begat Esrom and Esrom begat Aram
1.Ve'Ram ho'lid et-Ami'na'dav ve'Ami'na'dav ho'lid et-Nach'shon ve'Nach'shon ho'lid et-Salmon
2.And Aram begat Aminadab and Aminadab begat Naasson and Naasson begat Salmon
1.Ve'Salmon ho'lid et-Boaz me'Ra'chav oo'Voaz ho'lid et-O'ved me'Root ve'O'ved ho'lid et-Yi'shai
2.And Salmon begat Booz of Rachab and Booz begat Obed of Ruth and Obed begat Jesse

2) Have the cursor on any place, no matter

3) Open the FIND dialog

4)
Find: ^1.*
(o) Entire Scope
[X] Regular Expressions

Click at [Copy]

5) I get a new document called "Search Result" which contains:

Quote:
1.Ze se'fer tol'dot ha'Ma'shi'ach Yeshua ben-David ben-Avraham
1.Av'ra'ham ho'lid et-Yitzchak ve'Yitzchak ho'lid et-Yaakov ve'Yaakov ho'lid et-Yehooda ve'et-echav
1.Vi'Y'hoo'da ho'lid et-Pe'retz ve'et-Ze'rach mi'Tamar oo'Fe'retz ho'lid et-Chetz'ron ve'Chetz'ron ho'lid et-Ram
1.Ve'Ram ho'lid et-Ami'na'dav ve'Ami'na'dav ho'lid et-Nach'shon ve'Nach'shon ho'lid et-Salmon
1.Ve'Salmon ho'lid et-Boaz me'Ra'chav oo'Voaz ho'lid et-O'ved me'Root ve'O'ved ho'lid et-Yi'shai

.

.

--
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 ^


Goto Page: 1 2 Next





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