How to tell if a text file has tabs in it ?

brgdotnet used Ask the Experts™
How can I tell i a text file has tabs in it? I have code, but it is not recognizing the tabs, so I am wondering if there are actually tabs in the text file.
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Dr. KlahnPrincipal Software Engineer

The legacy method would be to read the text file line by line, parsing each line to see if there is a 0x11 / HT / horizontal tab character in any byte.

Regrettably that method works 100% only in ASCII / UTF-8 source files.  For files encoded in other character sets the situation is more complicated.


Thanks. Is there any editing tool which might physically show the actual tab? I Think the old Word Perfect use to allow for that type of feature. It would be real nice if I could somehow examine the file, and observe the embedded control characters.
Principal Software Engineer
If Microsoft Word is set to "Show / hide paragraph marks" it will show all special characters, including tabs.

Word "Show/hide paragraph marks"

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial