Hi, Bruce!

:-D
I've also thaught about this, but I didn't manage to get this working!

Take a look please, there are some major and minor problems:


On 13 Dec 2017, at 6:43, Bruce Van Allen wrote:

Hi Vlad,

For some reason, I can't get BBEdit's Sort Lines... Using Search Pattern to work, but this worked:

Step 1 - Reverse the sequence of each line's parts:
------
Find:
^([\*-]) ([^-]+?) - ([^\n]+)\n

Replace:
\3 - \2 \1\n

This yields:
The Beatles - Blackbird -
The Beatles - For No One -
Elvis - Hound Dog *
Melanie - I Don't Eat Animals -
...

It kind of worked… with the exception of the very last line

The Beatles - Blackbird -
The Beatles - For No One -
Elvis - Hound Dog *
Melanie - I Don't Eat Animals -
Pink Floyd - Is There Anybody Out There -
The Beatles - Let It Be -
Ed Sheeran - Photograph -
James Blunt - Same Mistake *
Adele - Someone Like You -
Elvis - That’s All Right *
Ed Sheeran - Thinking Out Loud *
David Gray - This Years Love -
The Righteous Brothers - Unchained Melody *
Pink Floyd - Wish You Were Here -
The Beatles - Yesterday -
Janiva Magness - You Were Never Mine -
The Traveling Willburys - End Of The Line *
The Traveling Willburys - Handle With Care -
The Eagles - Hotel California -
The Eagles - Lyin' Eyes -
Paul McCartney & The Wings - Mull Of Kintyre -
The Eagles - Peaceful Easy Feeling -
Eric Clapton - San Francisco Bay Blues *
The Eagles - The Best Of My Love -
Roy Orbison - You Got It -
Pink Floyd - Wish You Were Here *
Led Zeppelin - Babe I'm Gonna Leave You *
The Beatles - Blackbird -
The Beatles - For No One -
Pink Floyd - Is There Anybody Out There -
Eric Clapton  - Tears In Heaven *
Ed Sheeran - Thinking Out Loud *
Janiva Magness - You Were Never Mine -
- Yesterday - The Beatles

Strange minor issue: Yesterday was a double entry and the first line with Yesterday was fine!

AND a MAJOR issue: This brings the artist on the first place…


Step 2 - Text -> Sort Lines with no specification, and get:
------
Adele - Someone Like You -
David Gray - This Years Love -
Ed Sheeran - Photograph -
Ed Sheeran - Thinking Out Loud *
Ed Sheeran - Thinking Out Loud *
Elvis - Hound Dog *
...

… and sort works its magic on artist, not on title, as I wanted :-(



Step 3 - Restore the original sequence of each line's parts:
------
Find:
^([^-]+?) - ([^\*-]+?) ([^\n])\n

Replace:
\3 \2 - \1\n

And I think that gives you what you want.

So: Not exactly, no. :-)


Regards,
Vlad







On 12/13/17 at 8:46 PM, [email protected] (Vlad Ghitulescu) wrote:
I’ll correct this right now: I would like to sort alphabetically this
list of songs in regard to column 3 (where the title of the song
begins) (Thanks again, Chris! ;-)

- Blackbird - The Beatles
- For No One - The Beatles
* Hound Dog - Elvis
- I Don't Eat Animals - Melanie
- Is There Anybody Out There - Pink Floyd
- Let It Be - The Beatles
- Photograph - Ed Sheeran
* Same Mistake - James Blunt
- Someone Like You - Adele
* That’s All Right - Elvis
* Thinking Out Loud - Ed Sheeran
- This Years Love - David Gray
* Unchained Melody - The Righteous Brothers
- Wish You Were Here - Pink Floyd
- Yesterday - The Beatles
- You Were Never Mine - Janiva Magness
* End Of The Line - The Traveling Willburys
- Handle With Care - The Traveling Willburys
- Hotel California - The Eagles
- Lyin' Eyes - The Eagles
- Mull Of Kintyre - Paul McCartney & The Wings
- Peaceful Easy Feeling - The Eagles
* San Francisco Bay Blues - Eric Clapton
- The Best Of My Love - The Eagles
- You Got It - Roy Orbison
* Wish You Were Here - Pink Floyd
* Babe I'm Gonna Live You - Led Zeppelin
- Blackbird - The Beatles
- For No One - The Beatles
- Is There Anybody Out There - Pink Floyd
* Tears In Heaven - Eric Clapton
* Thinking Out Loud - Ed Sheeran
- You Were Never Mine - Janiva Magness
- Yesterday - The Beatles

The - or * have a meaning for me but translate the same in Markdown.
They also mystify ;-) the normal sort: that’s the output after sort lines

- Blackbird - The Beatles
- Blackbird - The Beatles
- For No One - The Beatles
- For No One - The Beatles
- Handle With Care - The Traveling Willburys
- Hotel California - The Eagles
- I Don't Eat Animals - Melanie
- Is There Anybody Out There - Pink Floyd
- Is There Anybody Out There - Pink Floyd
- Let It Be - The Beatles
- Lyin' Eyes - The Eagles
- Mull Of Kintyre - Paul McCartney & The Wings
- Peaceful Easy Feeling - The Eagles
- Photograph - Ed Sheeran
- Someone Like You - Adele
- The Best Of My Love - The Eagles
- This Years Love - David Gray
- Wish You Were Here - Pink Floyd
- Yesterday - The Beatles
- Yesterday - The Beatles
- You Got It - Roy Orbison
- You Were Never Mine - Janiva Magness
- You Were Never Mine - Janiva Magness
* Babe I'm Gonna Live You - Led Zeppelin
* End Of The Line - The Traveling Willburys
* Hound Dog - Elvis
* Same Mistake - James Blunt
* San Francisco Bay Blues - Eric Clapton
* Tears In Heaven - Eric Clapton
* That’s All Right - Elvis
* Thinking Out Loud - Ed Sheeran
* Thinking Out Loud - Ed Sheeran
* Unchained Melody - The Righteous Brothers
* Wish You Were Here - Pink Floyd


Regards,
Vlad





On 12 Dec 2017, at 21:37, Tom Robinson wrote:

Everything up to the song title is identical, so just do a normal sort:

Select the text to sort… or no selection will sort entire document
Text > Sort Lines
Turn on Sorted lines replace selection, and turn off everything else.




On 2017-12-13, at 09:17, Vlad Ghitulescu <[email protected]> wrote:

Hi, Tom!


Thanks for your reply!

The list is not sort by song title.


Regards,
Vlad




On 12 Dec 2017, at 21:13, Tom Robinson wrote:

Looks like it’s already sorted by song title, so assuming you mean artist:

Text > Sort Lines
Turn on Sort using pattern
Enter search pattern of ‘ - (.+)$’ (without the quotes). This ‘captures’ the artist name which comes after a hyphen. Sort by ‘All sub-patterns’ — the text you’ve just captured within the brackets.

You can also issue a normal find using the same regular expression (pattern), to see how that bit works.

Cheers


On 2017-12-13, at 08:46, Vlad Ghitulescu <[email protected]> wrote:

Hello!

I would like to sort alphabetically this list of songs:

 • Blackbird - The Beatles
 • For No One - The Beatles
 • Hound Dog - Elvis
 • I Don't Eat Animals - Melanie
 • Is There Anybody Out There - Pink Floyd
 • Let It Be - The Beatles
 • Photograph - Ed Sheeran
 • Same Mistake - James Blunt
 • Someone Like You - Adele
 • That’s All Right - Elvis
 • Thinking Out Loud - Ed Sheeran
 • This Years Love - David Gray
 • Unchained Melody - The Righteous Brothers
 • Wish You Were Here - Pink Floyd
 • Yesterday - The Beatles
 • You Were Never Mine - Janiva Magness
 • End Of The Line - The Traveling Willburys
 • Handle With Care - The Traveling Willburys
 • Hotel California - The Eagles
 • Lyin' Eyes - The Eagles
 • Mull Of Kintyre - Paul McCartney & The Wings
 • Peaceful Easy Feeling - The Eagles
 • San Francisco Bay Blues - Eric Clapton
 • The Best Of My Love - The Eagles
 • You Got It - Roy Orbison
 • Wish You Were Here - Pink Floyd
 • Babe I'm Gonna Live You - Led Zeppelin
 • Blackbird - The Beatles
 • For No One - The Beatles
 • Is There Anybody Out There - Pink Floyd
 • Tears In Heaven - Eric Clapton
 • Thinking Out Loud - Ed Sheeran
 • You Were Never Mine - Janiva Magness
 • Yesterday - The Beatles
in regard to column 3 (where the title of the song begins).

Could you please give me a hint?

Thanks!

Regards,
Vlad

--
This is the BBEdit Talk public discussion group. If you have a
feature request or would like to report a problem, please email
"[email protected]" rather than posting to the group.
Follow @bbedit on Twitter: <http://www.twitter.com/bbedit>
---
You received this message because you are subscribed to the Google Groups "BBEdit Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/bbedit.



--

  - Bruce

_bruce__van_allen__santa_cruz__ca_

--
This is the BBEdit Talk public discussion group. If you have a feature request or would like to report a problem, please email
"[email protected]" rather than posting to the group.
Follow @bbedit on Twitter: <http://www.twitter.com/bbedit>
--- You received this message because you are subscribed to the Google Groups "BBEdit Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/bbedit.

--
This is the BBEdit Talk public discussion group. If you have a feature request or would like to report a problem, please email
"[email protected]" rather than posting to the group.
Follow @bbedit on Twitter: <http://www.twitter.com/bbedit>
--- You received this message because you are subscribed to the Google Groups "BBEdit Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/bbedit.

Reply via email to