-1

I have a data file looks like:

1 2 3 4
5
6
7
8 9
10 11
12 13
14
15 16 17
18 19 20 21

I want to delete all the rows in which only the first column is full. so output should be :

1 2 3 4
8 9
10 11
12 13
15 16 17
18 19 20 21

any suggestion ?

  • 1
    What do you mean by "full"? You mean rows with only 1 column? – Barmar Jan 27 '17 at 23:54
  • Are you looking for a script using bash, awk, sed, grep etc ? Or can another programming language be used for that like python, perl, php, js or other? – Wadih M. Jan 27 '17 at 23:55
  • 3
    awk 'NF > 1' filename – Barmar Jan 27 '17 at 23:55
  • Full is completely confusing. According to your expected output you want to omit lines with just one number. – George Vasiliou Jan 28 '17 at 1:05
0
$ grep -E '[0-9]..' c2.txt
1 2 3 4
8 9
10 11
12 13
15 16 17
18 19 20 21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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