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'm working with a huge datafile (about 400,000 rows and 8 columns) in Libre Office. I need to get rid of certain rows so I selected all cells with the desired value (with Find & Replace) and tried Edit > Delete Cells > Delete entire row(s). The screen is fading and still, after some 15 minutes it doesn't get me anywhere (screen fades to grey, program does not respond). Selecting "only" some thousand rows resulted in the same.

Is there an alternate way to get rid of thousands of rows at the same time? Solutions in Libre Office, Gnumeric or R or any other open software are very welcome.


The data is organised in this way (small sample):

Region, TimePeriod, etc, ValueTons

Cyprus, JanDec 2000, somecodes, 0
Cyprus, JanDec 2001, somecodes, 74.2
Cyprus, JanDec 2002, somecodes, 68.7
Cyprus, JanDec 2003, somecodes, 59.1
Cyprus, JanDec 2004, somecodes, 50.3
Cyprus, JanDec 2005, somecodes, 71.1
Cyprus, JanDec 2006, somecodes, 45.7
Cyprus, JanDec 2007, somecodes, 45.7
Cyprus, JanDec 2008, somecodes, 50.4
Cyprus, JanDec 2009, somecodes, 80
Cyprus, JanDec 2010, somecodes, 47.2
Cyprus, JanDec 2011, somecodes, 44.1
Spain, JanDec 2000, somecodes, 5
...

The time period ranges from 2000 to 2011. I need to get rid of all rows containing the years 2000 to 2005 and 2011.

share|improve this question
1  
what format is the file in? csv? –  JackeJR Feb 21 '13 at 15:54
    
Forgot to add that. I can save it in .csv if that is of help. At the moment it is an .ods file. –  Stockfisch Feb 21 '13 at 15:57
    
if you have enough ram, you can easily read it into R using read.csv and filter from there. if you do not have enough ram, you can still use sqldf package to do the same –  JackeJR Feb 21 '13 at 16:31
    
How many are the remaining rows? Maybe it would be easier to just copy the remaining rows to another file than deleting too many rows? –  spapakons Feb 21 '13 at 16:45
    
if you want more help, try posting a segment of your data and what you want to filter by. this makes it easier for others to help. –  JackeJR Feb 21 '13 at 17:52
show 2 more comments

1 Answer

Try that:

1.Save it as CSV.

  1. Rename it to TXT (if on Windows, uncheck the checkbox to hide known extensions, on tools > options to show extensions), only to LibreOffice does not try to open it with Calc.

  2. Open it with Write. To do it more clear for eyes, select Dysplay > Web Layout.

  3. Select lines you want to erase and do it. From first line, put cursor before first character, then hold shift and use down arrow page up/down keys to select the lines to delete.

  4. After ending the deletion of unimportant lines, save the file (as TXT) and rename it back to CSV.

Note: You will delete all formulas if exist.

share|improve this answer
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.