Hi. I got a working custom text facet statement from an 'AI' that identifies all the empty columns in a project. As far as I can tell, the only way to delete those columns is one by one from the column header dropdowns. I work in library metadata and one of my tasks is cleaning up catalog record exports that include many, many empty columns. It would be great if I could use a facet/filter list of empty columns to delete them all at once.
Have you tried the 'All' column drop down--Edit columns--Re-order/Remove columns and then selecting the columns you want to remove? I'm wondering if that's a possible solution.
@GW_Swicord, here is how you can do it in a couple of steps.
-
Identify all the columns that are empty using
All > Facet > Blank value per column
-
For each column compare the total blank with the number of row in your project. If they match it means the column only contains blank value.
-
Open the re-order / remove columns feature under
All > Edit columns > re-order / remove columns
as shown in @HelsKRW previous message. -
Here, just change the order of two columns.The goal is to generate the JSON history in order to allow for manual editing, instead of having to remove each column manually.
-
Go under
under/redo
and selectExtract
-
Select only the column reorder column and copy past the JSON in a text editor
-
In the text editor, delete the line matching each column name you want to remove. You may need to adjust the comma at the end of each line to keep the JSON valid
-
Under Undo/redo use the
apply
and paste your edited JSON. -
The project will keep only the list of columns explicitly listed in the JSON file and remove all the other ones.
This should be a single button click for users.
@thadguidry I agree! I think this is another vote for Allow Users and Extensions to customize a Custom Menu (Tools/Other) area · Issue #109 · OpenRefine/OpenRefine · GitHub so we can support macro
I think having the option to skip empty columns on import would go a long way towards addressing the needs here:
https://github.com/OpenRefine/OpenRefine/issues/1750
Tom