• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Too many letters in Alphabet List & Suggestion for creating Setlists
Hello Mike, Hello all,

after importing a big number of sheets via csv (Jims Guitar- and Ukulele Songbook as referenced in the forum here: https://zubersoft.com/mobilesheets/forum...-9135.html) my library has grown to around 8000 songs. And presumably because of this there is a bug with the alphabetic list on the right side (see photo below): there are multiple copies of the same letter and there are double "inbetween"-letters, e.g. BA - B - BE - B - BE ...
Some of these don't go anywhere when touching them, some go to wrong places. And even if they go to a song with "BA" as the first two letters it is very unpractical to have to scroll on the right side for ages in a situation where I want to find a song quickly without typing in anything. It would be nice to just have an alphabetic list A - B - C - D - ... back.

A second thing: When going to the "Setlists"-Tab, choosing a setlist and going on "Edit" there is no search field anymore. It would be very nice to have the possibility to search/filter the songs for new additions to a setlist.

Have a nice Sunday!

Attached Files Thumbnail(s)
Hello Malte,

I'll need to know what you have selected for the following settings:

1) Settings->Library Settings->Ignore Articles While Sorting
2) Settings->Library Settings->Articles To Ignore
3) Settings->Library Settings->Normalize Characters
4) Settings->Library Settings->Use Language Sorting Rules

In order to test this, should I just import every song from the CSV that you linked to?

Hello Mike,

thanks for getting back to me so quickly!

1) Settings->Library Settings->Ignore Articles While Sorting is turned On
2) Settings->Library Settings->Articles To Ignore is the default setting: no entry (but that changes to "A, An, The" when I change the language to English which I mostly do to be able to communicate the appropriate settings names here in the forum)
3) Settings->Library Settings->Normalize Characters is turned On
4) Settings->Library Settings->Use Language Sorting Rules is turned On

Yes, I would assume that importing all the songs from Jim's guitar or ukulele fake book caused this issue. It would be very kind if you could try to reproduce it on your device.

Concerning the second thing: Is this the way it should be and I'm just missing an other option to comfortably add songs to a setlist with the option to filter or would this be something you could add to the edit-setlist-screen?

As far as I can tell, the problem is caused by that CSV file having BOM markers (a zero width space) at the beginning of every line which MobileSheets is not currently stripping out (I'll fix that with the next update). This causes almost every line to start with a zero-width space character which causes issues with the detection of the letters for the alphabet list. I'm seeing a little bit of a different problem than you (every song is placed into the # section), but I'll try testing with no articles to ignore to see if that makes a difference. If you want a workaround to fix the issue in the meantime, you would have to delete every song you imported from that CSV, fix the CSV to not have BOM markers at the beginning of every line and then reimport it. As it stands, if you edit your songs, you should see an extra character at the start of most song titles. If you delete that, it may resolve the issues, but you'd have to do that for every song...

As far as the second issue, in the group editor, tap the three dots at the top right and tap "Show Filters". That's all you need to do to have access to the searching/filtering functionality.



The CSV has two zero width spaces before the title "Already Gone", which is even more strange. It definitely would be good to update that file to remove those zero width spaces...
After updating the code to strip out the BOM markers for each line, the alphabet list was correct again. Unfortunately, it does not seem possible to easily remove that from the song titles though using the song editor (as Apple's text field does not show the zero width space). If you want my help with this, the easiest thing is probably to modify the database itself. Go into the MobileSheets folder, then email mobilesheets.db to mike@zubersoft.com. I'll run some queries to remove the zero width spaces from your song titles, then send the database file back to you. You can then replace mobilesheets.db in the MobileSheets folder, restart MobileSheets and the alphabet list should be fixed.


Might be a good idea to strip out all characters below a space from the start of the name - this would also remove your NUL characters i.e. no special test for NUL required.

Being defensive, you might also want to strip any at the end of the line or possibly any within the line!

You could also probably strip leading/trailing spaces in the song name (but I use leading spaces in Setlist names so please don't reuse the code to strip them there)

Samsung Galaxy Tab A6
The problem is that on Android and Windows, I believe the string trimming methods already do that - they remove characters below a space. With Swift on iPadOS, strings are implemented in an incredibly different fashion, so while I have used the built-in capabilities to remove whitespace and newlines, it doesn't seem as straightforward to take a character from a string (which may be represented with multiple scalar values) and compare it against a space in an "integer-like" fashion. There may be a way to do this properly, but I'm worried about hacking together a solution that may have errors or unintended effects when dealing with characters like emojis. It may be something like 

while str.count > 0 && str.charAt(0).isAscii && str.charAt(0).asciiValue < 32 {
   str = str.substring(1)

or something to that effect, but I would need to do a lot of testing to verify this works in every situation first. I tested it with some simple cases and it does appear to work properly though.

Hello Mike,

thanks, it's great that you immediately found the problem and shared so much information about how to deal with it!

Unfortunately I'm not really able to fix that CSV in any convenient way because these weird leading spaces are displayed in Excel as black diamonds with question marks in them and I don't know enough about character encoding formats to clear this up. But I will remark this in the thread of the CSV and maybe itsme, who authored the CSV, can help with this.

I can confirm that it's not possible to edit the song titles in song editor - that is the same for me.

I will send you the database, but I feel a little uncomfortable wasting your time with such a thing, especially as I haven't even used the "Jim's Songbook"-songs yet. If it fixes itself in the next update I can absolutely wait for that.

As a side note: I would have otherwise tried to delete all the songs from "Jim's Songbook", but as far as I was able to try out, there is no option to delete a huge number of songs, I mean to filter out certain songs with the search field, then select all of them and delete them. Could you confirm that this is currently not possible or is there again an option that I am not seeing?

Thanks for your help with the setlist thing!

To delete a large number of songs, the best thing to do is use a filter that will only show those songs, use the "Select All" icon in the floating toolbar, and then delete them. That is really the only way to handle it effectively. Also, just to be clear, the next update will fix the issue after importing a csv, but it will not fix your existing songs. So you would still have to delete those. I can fix the CSV if needed - it's relatively easy to do with notepad++.

Hi Mike,

finally I found all of the things you described and got it to work for now. Thank you for all of your help!

You are very welcome. I'm still in the process of trying to fix your database - unfortunately it has not been easy as the SQLite tool does not seem to be handling the zero width space. I may not be able to fix it...

Well I did figure out a way to fix the database, however I would need a second copy of it as I accidentally stripped one extra character from each of the song titles. If you would like me to fix it, send me another copy (as I see the one you uploaded to OneDrive is gone now), otherwise I'll assume you are good to go.

Hi Mike,

I re-imported all the songs and only in the guitar-version, so I think my database is fine now. Thanks again for your looking into it! As always I learned and discovered some new little features while trying to get this right, so I'm very happy how it all worked out in the end.

I'll comment some more stuff in the other thread because I had to edit some more stuff in the csv before it running cleanly.


Users browsing this thread:
2 Guest(s)

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2024 MyBB Group.