![]() |
#1 |
Junior Member
![]() Posts: 5
Karma: 10
Join Date: Jan 2020
Device: kindle
|
rearrange paragraph
Hi there,
I have a book like that: <p id="2">paragraph 1</p> <p id="5">paragraph 2</p> <p id="1">paragraph 3</p> ... I want to edit it back to an id increase order like this: <p id="1">paragraph 3</p> <p id="2">paragraph 1</p> ... <p id="5">paragraph 2</p> Does anybody know how to do it? Thanks in advance |
![]() |
![]() |
![]() |
#2 |
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 30,891
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
By hand, using the Editor (or alternate).
This is so far into the far edge of requests that I have seen hear over the years. ![]() I would almost believe, you are trying to fix a PDF conversion that ended up, typically bad. |
![]() |
![]() |
![]() |
#3 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,306
Karma: 13057279
Join Date: Jul 2012
Device: Kobo Forma, Nook
|
Paste it into a site like Text Mechanic:
https://textmechanic.com/text-tools/...rt-text-lines/ and do a Natural Sort on it. You can also use any other program that sorts too... like spreadsheet programs (Excel, LibreOffice Calc, Google Sheets, etc.) |
![]() |
![]() |
![]() |
#4 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 5,680
Karma: 23983815
Join Date: Dec 2010
Device: Kindle PW2
|
If you have basic Python skills, you could use the Beautiful Soup Python library to manipulate the file.
|
![]() |
![]() |
![]() |
#5 |
A Hairy Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,301
Karma: 20171571
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 15/11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
|
I would just use the Incremental IDs plugin.
If it doesn't overwrite the current ID, you can have it make an incremental 'title='...then basic regex search/replace to swap 'title' to 'id'. |
![]() |
![]() |
![]() |
#6 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,450
Karma: 5703586
Join Date: Nov 2009
Device: many
|
And fwiw ids should really not start with a numerical digit.
|
![]() |
![]() |
![]() |
#7 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 13,285
Karma: 78869092
Join Date: Nov 2007
Location: Toronto
Device: Libra H2O, Libra Colour
|
|
![]() |
![]() |
![]() |
#8 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 28,352
Karma: 203720150
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
The problem is that they want to actually reorder the paragraphs in the document, according to the id number. This isn't about rewriting/reorganizing ids, I'm pretty sure it's about rearranging actual content based on the ids.
|
![]() |
![]() |
![]() |
#9 | |
Junior Member
![]() Posts: 5
Karma: 10
Join Date: Jan 2020
Device: kindle
|
Quote:
Thank you all so much |
|
![]() |
![]() |
![]() |
#10 | |
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 30,891
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Quote:
![]() ![]() I just thought the order was changing |
|
![]() |
![]() |
![]() |
#11 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 28,352
Karma: 203720150
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
|
![]() |
![]() |
![]() |
#12 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,450
Karma: 5703586
Join Date: Nov 2009
Device: many
|
|
![]() |
![]() |
![]() |
#13 |
Running with scissors
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,582
Karma: 14328510
Join Date: Nov 2019
Device: none
|
|
![]() |
![]() |
![]() |
#14 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,306
Karma: 13057279
Join Date: Jul 2012
Device: Kobo Forma, Nook
|
Quote:
What are you trying to accomplish? Do you have a large collection of quotations + page numbers? If you let us know the surrounding context, there may be even better solutions out there. ![]() Last edited by Tex2002ans; 01-27-2020 at 05:54 PM. |
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
How can I rearrange chapters? | laundmo | Editor | 3 | 12-18-2018 04:16 PM |
Cannot rearrange files in Book Browser | BartB | Sigil | 3 | 12-18-2011 11:52 AM |
Preference: Paragraph indent or a little paragraph spacing? | 1611mac | General Discussions | 48 | 11-11-2011 12:43 AM |
Classic Rearrange touchscreen icons on Classic? | ynot | Barnes & Noble NOOK | 2 | 05-08-2011 05:40 PM |
rearrange pic order in gallery | MULTIZ321 | Barnes & Noble NOOK | 16 | 01-15-2011 01:22 AM |