Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've got a tab delimited file, is there an easy way for me to count the total number of tabs on a line?

I have opened it up in excel, but excel is limited to 256 columns and I think each line of my file has more than this limit

I've found the option in notepad++ to show tabs as arrows, but that doesn't help me determine how many there are, and I don't really want to have to count each one manually

If there isn't an easy way in notepad++, what are my other options?

share|improve this question
up vote 6 down vote accepted

You could search for the tab character in the file. Go to Search -> Find..., in the Find what field paste the tab character (it will probably look like a box) and click on Count. Unfortunately, this only gives you the total number of tabs in the document, not the total number of tabs in the line, even if you choose the In selection.

share|improve this answer
The OP could simply resolve that by temporarily limiting the file to one line. – Paul Lammertsma Dec 16 '09 at 10:34
He could do that, I know. I was just telling him the whole story so he's aware of the limitation. – alex Dec 16 '09 at 12:17
You can also search for the tab character as \t if you have search mode set to "Extended (\n, \r, \t, \0, \x...)" – JustinStolle Nov 27 '11 at 7:22
Alternately, you can replace a tab with a tab, which would give you the option of only including those that are in the selection; a count of the replacements made is shown upon completion. – JustinStolle Nov 27 '11 at 7:27

I would convert the tabs in that line into a enter character and count how many lines you have. the number of tabs would be equal to the total number of lines - 1.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .