LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   filter a data sheet for blank spaces (https://www.linuxquestions.org/questions/linux-newbie-8/filter-a-data-sheet-for-blank-spaces-437029/)

tjgadu 04-20-2006 04:09 AM

filter a data sheet for blank spaces
 
I have a datasheet with data organised in columns and seperated by tabs. I am trying to filter out only those rows where data are missing.

eg

1 2 3 4
5 7 8

that is I am trying to retrieve the second row but in vain. If the columns were seperated by spaces I could have use d the class name [[:space:]] with grep to get the result.. is there a related class name for tab? or is there another method than grep to obtain the desired result..

tmillard 04-20-2006 11:30 AM

Try using sed. I have a book that I need to find and then will post mor information when I find it.

tmillard 04-20-2006 11:39 AM

Code:

sed '/^$/d' "input file"
Deletes all blank lines


All times are GMT -5. The time now is 10:38 PM.