Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have a huge csv file (tens of thousands of rows) that I need to filter based on different criteria. After trying to find a proper CSV editor, I decided to use LibreOffice Calc. CSVed is great, but it doesn't support neither UTF-8 nor macros for advanced filtering.

So, there are 4 columns, 3 of which contain numbers (with decimal numbers) and 1 of which contains text.

I'm trying to find a way to delete rows with a macro code. I can achieve the desired behavior with filters too, but it's annoying to type all of the filtering values over and over again and there doesn't seem to be a way to export the filter and us it repeatedly.

These rows should be deleted:

  1. The ones that don't contain certain words in textual column (column A). There are a few thousand different words used in that column and I want to keep only the rows that contain one of about 30 words in that column.

  2. Additionally, the number is the other columns should be bigger than 3.8 (column B), 4.5 (column C) and smaller than 20 (column C).

The row-deletion type is "Shift up".

Hopefully I have explained it well. Thanks a lot in advance for your help!

share|improve this question
add comment

1 Answer

I realize this isn't answering your question, and OOcalc is a great tool, but perhaps you didn't look at CSVfix? definitely a "proper CSV editor" IMO, just not a GUI tool; it works from the console. However this makes it easy to script your parameters into batch files for regular re-use, and it supports regular expressions and numeric ranges for both include and exclude operations.

share|improve this answer
    
It seems like a good program, but I have lost one hour trying to set it up. I really don't get why good programs often don't have any UI. It could be a good tool though. –  take2 Sep 6 '12 at 17:05
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.