title: python detect tab char
body: <p>I was trying to split words and ints inside a specific file. File's strings are in these form (line that contains word has not '\t' char but int numbers(all positive) have):
  (some words are numbers containing '-' char, )</p>
  
  <pre><code>-1234
  \t22
  \t44
  \t46
  absv
  \t1
  \t2
  \t4
  ... 
  </code></pre>
  
  <p>So my idea was to split words and strings by casting the line's object to float.</p>
  
  <pre><code>def is_number(s):
      try:
          float(s)
          return True
      except ValueError:
          return False
  
  with codecs.open("/media/New Volume/3rd_step.txt", 'Ur') as file:#open file
      for line in file: # read line by line
          temp_buffer = line.split() # split elements
          for word in temp_buffer:
              if not('-' in word or not is_number(word)):
              ....
  </code></pre>
  
  <p>So if it was a word I would get exceptions if not then it is a number. The file is 50 Gb , and somewhere in the middle it seems that something goes wrong with the file's format. So the only possible way to split words and numbers is with the \t char. But how can I detect it? I mean I split the line to get the string and I lose the special chars that way.</p>
  
  <p>EDIT:</p>
  
  <p>I am really silly and newbe sorry for wasting your time. It seems that I can find it easier with this way:</p>
  
  <pre><code>with codecs.open("/media/D60A6CE00A6CBEDD/InvertedIndex/1.txt", 'Ur') as file:#open file
      for line in file: # read line by line
      if not '\t' in line:
              print line
  </code></pre>