Search code examples
openrefine

OpenRefine: Remove row if specific cell in this row is empty


The input for OpenRefine is a csv file containing data like this

phy,205.4,,,Unterwasserakustik. Sonar-Technik,,
phy,205.6,,,Lärm. Lärmbekämpfung. Schallschutz. Filter (vgl.a.san 525),,
phy,205.9,,,Sonstiges,,
,,,,,,
,,Wärme. Statistische Physik (Temperaturstrahlung s. phy 495),,,,
,220,,Gesamtgebiet,,,

I would like to remove all rows where the second column (the numeric code) is empty.

In Open Refine I created a Facet->CustomizedFacet->FacetByBlank on the second column. In the appearing menu on the left, I clicked true (197 false, 2 true - which is correct). Then, I went to All->EditRows->RemoveAllMatchingRows. Instead of removing only the two rows, OpenRefine removes 143 rows and no data is shown anymore.

What has happend? And how can I remove only the two rows with an empty second column?

It might be connected to the row counter in the All column: The first time the entry in the first column "phy" is missing, there is no row count anymore.

1. phy 205.4 ...
2. phy 205.6 ...
3. phy 205.9 ...
             Wärme...
       220 ...

The 220 row does not contain the "phy" column and is incorrectly ignored.


Solution

  • It looks like you may be operating in "record mode" as opposed to "row mode." If the facet says 197 true, 2 false, you should only see two rows displayed on the screen when you go to do your delete. If you see more than that try selecting Row mode.