rlindau wrote:I'm seeking an app (linux or web - or possibly a dos/windows app that might run under wine) that will let me sort my abc tunebooks. Any ideas?
Some background: I'm running Linux Mint 10 (~Ubuntu 10.10) with wine 1.3.8. I had used abc2win for years, and was able to get it work after I switched to linux (running it under wine), but but I can no longer get it to run with my current linux/wine release. I'm now trying out ABCJ as my main abc tool. There's a lot I like about ABCJ, but (unless I'm wacko) ABCJ can't sort tunebooks in tune name sequence (or, to sort the tune list display in name sequence, leaving the tunebook itself alone).
I guess I could use my text editor, but that would be a real pain-in-the-you-know-what.
Regards, Rob L
Code: Select all
" Lauched in GVIM (LINUX or WINDOWS versions) this ex command outputs .abc file sorted by titles
" GVIM VERSION = 7.3
" USAGE :
" - copy this file (under name "sort-titles.ex") and the .abc file to sort in an emply directory
" - open the .abc file in GVIM (file/open ...)
" - GVIM opened, type :so sort-titles.ex (or :so sort<tab>) <enter>
" - WAIT messages !
" - message in black and white are OK
" - if messages in color, errors in the output : don't use it
" - VIM processes the file, saves output, and quit
" The outpout is : sorted_MyAbcFile.abc
" SCRIPT :
" Rename "file" as "sorted_file
" Remove empty lines
" Add an empty line at the end of file
" Add an empty line before X: fields
" Put tag \n at the end of lines with text
" Join each tune in a single line
":w! debug " Put this line on step you want to check output
" Call VIM internal sort command
" An sorts on the _first_ T: field
:1,$sort i /^[^T]*T:/
" Reformat tunes on multiple lines
" Renumber X: fields (to disable this function, put a " at the beginning on the following line
:let i=1 | g/^X:/s/[0-9]*$/\=i/ |let i=i+1
":let i=10000001 | g/^X:/s/[0-9]*$/\=i/ |let i=i+1
" Save Renamed file and quit
" COMMENTS :
" In Others Words, we :
" - put each tune on a signe line
" - sort the file vith VIM internal sort fonction (/^.*T:/ skips text before title)
" - reformat the tunes in their usual format
"WARNING !!! ALL THE FREE TEXT _AROUND_ THE TUNES IF REMOVED ! (see sample file and output)
" * ALWAYS KEEP A COPY OF THE ORIGINAL FILE ; DO NOT ERASE IT * !!!
"Licence : the same as GVIM
Users browsing this forum: No registered users and 0 guests