Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Sigil

Notices

Reply
 
Thread Tools Search this Thread
Old 01-27-2020, 12:27 AM   #1
songuyento
Junior Member
songuyento began at the beginning.
 
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
songuyento is offline   Reply With Quote
Old 01-27-2020, 12:57 AM   #2
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 30,891
Karma: 59840954
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.
theducks is offline   Reply With Quote
Advert
Old 01-27-2020, 03:23 AM   #3
Tex2002ans
Wizard
Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.
 
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.)
Tex2002ans is offline   Reply With Quote
Old 01-27-2020, 06:56 AM   #4
Doitsu
Grand Sorcerer
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 5,680
Karma: 23983815
Join Date: Dec 2010
Device: Kindle PW2
Quote:
Originally Posted by songuyento View Post
Does anybody know how to do it?
If you have basic Python skills, you could use the Beautiful Soup Python library to manipulate the file.
Doitsu is offline   Reply With Quote
Old 01-27-2020, 07:44 AM   #5
Turtle91
A Hairy Wizard
Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.
 
Turtle91's Avatar
 
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'.
Turtle91 is offline   Reply With Quote
Advert
Old 01-27-2020, 08:05 AM   #6
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 8,450
Karma: 5703586
Join Date: Nov 2009
Device: many
And fwiw ids should really not start with a numerical digit.
KevinH is offline   Reply With Quote
Old 01-27-2020, 08:52 AM   #7
PeterT
Grand Sorcerer
PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.
 
Posts: 13,285
Karma: 78869092
Join Date: Nov 2007
Location: Toronto
Device: Libra H2O, Libra Colour
Quote:
Originally Posted by KevinH View Post
And fwiw ids should really not start with a numerical digit.
Are there any non numerical digits?
PeterT is offline   Reply With Quote
Old 01-27-2020, 09:12 AM   #8
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 28,351
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.
DiapDealer is offline   Reply With Quote
Old 01-27-2020, 09:43 AM   #9
songuyento
Junior Member
songuyento began at the beginning.
 
Posts: 5
Karma: 10
Join Date: Jan 2020
Device: kindle
Quote:
Originally Posted by DiapDealer View Post
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.
Yes, it’s exactly what I wanted to do. And Tex2002ans’ suggestion site solved my problem.
Thank you all so much
songuyento is offline   Reply With Quote
Old 01-27-2020, 09:59 AM   #10
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 30,891
Karma: 59840954
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Quote:
Originally Posted by Tex2002ans View Post
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.)
I missed the wanted the ID to be sequential
I just thought the order was changing
theducks is offline   Reply With Quote
Old 01-27-2020, 09:59 AM   #11
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 28,351
Karma: 203720150
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Originally Posted by songuyento View Post
Yes, it’s exactly what I wanted to do. And Tex2002ans’ suggestion site solved my problem.
Thank you all so much
It looked like his was the one that might work.
DiapDealer is offline   Reply With Quote
Old 01-27-2020, 02:48 PM   #12
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 8,450
Karma: 5703586
Join Date: Nov 2009
Device: many
Quote:
Originally Posted by PeterT View Post
Are there any non numerical digits?

Yes the digits on each of my hands for example. ;-)
KevinH is offline   Reply With Quote
Old 01-27-2020, 03:15 PM   #13
hobnail
Running with scissors
hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.
 
Posts: 1,582
Karma: 14328510
Join Date: Nov 2019
Device: none
Quote:
Originally Posted by KevinH View Post
Yes the digits on each of my hands for example. ;-)
Roman numerals?
hobnail is offline   Reply With Quote
Old 01-27-2020, 04:44 PM   #14
Tex2002ans
Wizard
Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.
 
Posts: 2,306
Karma: 13057279
Join Date: Jul 2012
Device: Kobo Forma, Nook
Quote:
Originally Posted by songuyento View Post
Yes, it’s exactly what I wanted to do. And Tex2002ans’ suggestion site solved my problem.
Thank you all so much
I'm scratching my head over what you're actually using this for though.

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.

Quote:
Originally Posted by KevinH View Post
Yes the digits on each of my hands for example. ;-)

Last edited by Tex2002ans; 01-27-2020 at 05:54 PM.
Tex2002ans is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
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


All times are GMT -4. The time now is 04:45 AM.


MobileRead.com is a privately owned, operated and funded community.