Move sentences from one collection to another?

Is it possible to move sentences from one collection to another? I accidentally added a bunch of sentences to the wrong collection.

Also, I noticed when I do a “global” search (search button at the top) it doesn’t find my custom added sentences. Not sure if bug or not, but it would be nice if it searched everything.

5 Likes

To the best of my knowledge the answer is “no”. I looked for this previously because I had originally created a collection about “Business and Money” but then realised it was getting too bloated and split parts of it off into separate categories like The Workplace. The only way I could do it was manually; that is, creating the workplace questions in the new collection and deleting them from the old Business and Money one.

You’re correct, though I’m not sure whether it’s a bug. Yesterday I added a sentence featuring the word “piovigginare” to my Weather collection, and indeed it doesn’t show up in a global search. However my guess is that currently the search option needs to scan only a single table; that being the table with the standard, public collection sentences in it. (Or it may be a view if they have all languages in the one table; in either case, it’s a search of everything that is publicly accessible and is therefore a simple, straightforward query.) If they were to a search of custom collections as well, they would also have to factor in the question of whether the person doing the search can even see that collection. For example there is no point showing a search result for a shared custom collection that a person may not have added. Also, there’s the question of non-pro members who (if I remember correctly) can’t see custom collections at all. (I could be wrong about that; I’ve been a pro member pretty much from the time I started so I can’t recall all of the restrictions.) In any case, being able to query custom collections as well would make for a more complex and processor intensive query, which is probably why they keep that one simple. (You can search WITHIN a custom collection via the collection management dialog, just not globally.) I don’t know how much work would be involved or how much processor time would be consumed expanding the search scope, but if I had to bet those two would be the drivers behind the words not appearing rather than it being a bug.

(But hey, I could be wrong…)

3 Likes

Hi @fyark,

There is a way to do it, but it requires you to get your hands dirty with a spreadsheet. I’m also assuming here that you have access to a PC to do this on (you may be able to do it on a tablet/phone, but I haven’t tried).

  1. Go to the collection that contains the sentences that you want to move. Click on the “manage sentences” button.
  2. Now Favourite :star: the sentences that you want to move. There may be quite a lot of these, on multiple pages.
  3. When you’ve favourited all the sentences that you want to move, you now need to go to the “Favourites” tab/box and click the cloud+down-arrow symbol to download the sentences that you’ve just selected. If you have favourite sentences from multiple collections, then they are grouped by originating collection, so you just click on the collection that you’re trying to move the sentences from. (At this point the pop-up message informs you of the output format of the file as a tab-separated list, and the order of columns). Save the file, and note down where it has been saved.
  4. Now you need to start up your spreadsheet program and open the file. Your spreadsheet program should recognize that it is a delimited text file, with tab as the delimiter. It it prompts you to change the file format before saving at any point, ignore those messages as you will need to save it again as a tab-separated file.
  5. You now need to manipulate the spreadsheet. Column A is the sentence, column C is the cloze word, and column D is the translation.
    i) Delete column B (this is the column that has the sentence with the cloze “highlighted”)
    ii) You now have 3 columns; A - sentence, B - cloze word, C - translation. You need to swap columns B and C. If you’re using Excel, then this 30 second video shows how to do it: How to switch two columns in Excel - YouTube
    iii) You now have 3 columns; A - sentence, B - translation, C - cloze word. Save the file (making sure that it is still saved as a tab-separated list).
  6. Now go back to Clozemaster and select the collection that you want to add these sentences to. Click the ädd sentences" :heavy_plus_sign: button, select the upload file button, and choose the file that you just modified/created. The sentences should now be added to your collection.
  7. Tidy up after yourself (delete the sentences from your old collection, delete the file that you just created if it is no longer needed, etc.).

The need to get a spreadsheet involved is due to the fact the output format of saving a file (from Favourties) is different to the input format when adding to a collection, otherwise this would be a much simpler process. I have no idea why it has been implemented like this. Perhaps @mike could shed some light on this little anomaly.

Please report back if this works for you (so that we know that the list of instructions is accurate and easy to follow).

3 Likes

That is certainly an out of the box workaround, and I for one am grateful for the favourites export suggestion since it will make checking for duplicate or redundant questions a lot easier than trying to do it manually. (In the “Manage Collection” option you have the option of making every question on the page a favourite without doing it one at a time. I should have thought of this before.)

However I’m going to stick with my answer of “no” for practical purposes.

Also, there are a couple of practical issues that I’d add relating to Excel:

It depends on which spreadsheet program. The classic functionality of Excel (like File → Open and the Text Import Wizard) is still stuck in the 90’s when it comes to dealing with foreign languages. Google Sheets will typically handle them better. However in Italian, for example, if you just open the file in Excel then accented characters will tend to be corrupted to all getout unless you start fiddling with the Registry to change the behaviour of the text import wizard, which can also cause problems.

Thankfully the newer functionality in Excel (from about 2013 on IIRC) overcomes this problem; specifically, by using the Data → Get Data dialog.

Initially the code page is wrong for the file that was exported from Favourites. Thus, we can see the distorted accented characters (like è) here:

Fortunately all you need to do is change the File Origin code to UTF8, and you should have uncorrupted text. For European languages, anyway. Asian languages I can’t comment on, but there should be an appropriate code there for them somewhere:

All well and good. If that’s all you want, it’ll work. For me, however, it leaves one huge hole, which is notes. The Import File option actually allows 5 columns, though only the first (sentence) is mandatory. Column 4 is “Pronunciation”. Column 5 is “Note”.

And the export from Favourites does not include the notes.

I put explanatory notes on pretty much every completely custom question that I write and have added them to a bunch of system questions that I’ve opted to include in my collections too. The only way I could bring them across to the new collection is by either manually adding them into the import sheet, or manually re-entering them after I’ve loaded them into the new collection.

Of course, you can’t export OR import hints, so there’s that as well.

If you have a LOT of questions to move then the export method above will be faster than recreating them from scratch, though adding the notes will still take a fair chunk of time. If it’s a relatively small number it can be easier to have two browser windows open and just copy from one to the other.

2 Likes

Thanks for the feedback! This should now be possible.

This :slight_smile:

@zzcguns thanks for posting the spreadsheet steps, that seems like a good alternative (and might still be a bit faster at the moment).

@LuciusVorenusX good points about the notes and hints not being exported - we’ll have to get those added at some point.

5 Likes

This is really nice. I have one collection which is just a general dumping ground of questions from the “most common” collections that I know I want to put into one of my subject collections, but am not sure which one yet. This will make redistributing those much easier when the time comes. I was also pleased to see an error message too (yes, this one was nice to see):
Errors

The “Text has already been taken” error occurs when the sentence is already in the target collection. That prevents any duplicates. Exxxcellent.

2 Likes

I have used this feature to successfully move all sentences from one collection to another, one by one. The only nit I have found is that it suggests the source collection as the target, which of course doesn’t work.

3 Likes
Polish Translation

Czy możesz się ruszyć?

The Polish translation of the sentence is incorrect. The correct translation is: Czy możesz się ruszyć?