Reputation: 8202
I have a file which is supposed to have exactly 8 columns on each line. But apparently there are a few lines that have an extra 'tab'. Is it possible in vi
to search for only those lines that contain column more than 8 so that the problem can be fixed?
Upvotes: 0
Views: 1279
Reputation: 31070
To search for any line with more than 8 characters try /^.\{8}.\+$
/
- start a search
^
- means "beginning of the line"
.
- any character
\{8}
- 8 of the preceding match (in this case... "any character")
.
- any character
\+
- 1 or more of the preceding match
$
- end of the line
Upvotes: 1