Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Grep or distinct to filter blank lines' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Grep or distinct to filter blank lines
Authored by: lullabud on Jul 17, '12 10:58:36AM
I used grep -v '^$' at the end to filter the blanks. Using uniq didn't seem to work. Using select distinct also works.

[ Reply to This | # ]
Grep or distinct to filter blank lines
Authored by: morespace54 on Jul 17, '12 12:28:31PM
Great tip (and the grep bit is a great addition)!
Now I can only wish Apple will keep the Terminal app for a long, long time (I would hate to see it disappear just because 'Average users can screw their computer with it' and because iOS doesn't have such a fine app)...

[ Reply to This | # ]
Grep or distinct to filter blank lines
Authored by: fracai on Jul 19, '12 07:10:33PM
uniq requires the duplicate lines to be consecutive. Otherwise they aren't removed. Another option is sort -u, but that will reorder the list. You could get complicated by printing the date column as well, then radix sort, uniquely on the URL column, and then non-uniquely by the date column.
---
i am jack's amusing sig file


[ Reply to This | # ]