Sort data in LibreOffice Writer
Peter Flynn
peter at silmaril.ie
Thu Feb 24 10:07:24 UTC 2022
On 24/02/2022 01:58, Tommy Trussell wrote:
> On Wed, Feb 23, 2022 at 5:25 PM Jay Ridgley <jridgley2 at austin.rr.com
> <mailto:jridgley2 at austin.rr.com>> wrote:
>
> Good evening.
>
> My wife has created a large number if recipe cards, over a period of
> several years, in a single file. Is there any way to alphabetize
> them by
> recipe name.
>
> They are formatted as a single page in most cases, however, a few are
> two pages long. The page if formatted for a 4x6 card. There are well
> over 200 of them. I have not seen anything that provides a clue on how
> to sort them.
>
> There is a title line (naturally) and a body but other than the title
> being on a single line at the top of the page they are just a file of
> data records.
>
> Here's one way
>
> (First of all, make a backupĀ of your file because you might mess
> something up.)
>
> Make sure you used the built-in styles for the titles (Title, or
> Heading1). If you didn't, you can copy the existing formatting to the
> Title or Heading1 style and apply them after the fact with a little effort.
>
> Then open the Navigator panel (compass icon on the right)
>
> You can see the Title or Headings in the panel and you can select one
> and use the tiny arrow icons near the top of the navigator to shuffle
> the items around. Put them in whatever order seems good. Moving them in
> the Navigator will move them to the respective place in the document.
>
> This isn't the ONLY way to do it, but it will probably be the most
> straightforward.
Very useful to know. It sounds like you have to sort them manually, but
I had no idea that moving the nav ref would physically rearrange the data.
I would probably have applied a Named Style to the title of each recipe
(if not already done), and then written some XSLT3 to do a sort on the
title and its related content (all the following material up to but not
including the next title).
Another approach is to break the file into 200+ separate files and name
them by names that the directory will order them by.
I'd probably find them easier to manage as separate files, but that may
just be the way my brain works. I'm writing some recipe-checking
software at the moment (http://xml.silmaril.ie/recipes/recipe/) and it
assumes separate files.
Peter
More information about the ubuntu-users
mailing list