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?


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.

  • 4
    The OP could simply resolve that by temporarily limiting the file to one line. – Paul Lammertsma Dec 16 '09 at 10:34
  • 2
    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
  • 1
    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.

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.