def _replace_tab_with_space(line, escapechar, quotechar):
 newline = []
 in_quote = False
 lastchar = 'NONE'
 for char in line:
  if ((char == quotechar) and (lastchar != escapechar)):
   in_quote = (not in_quote)
  if ((char == ' DCTB ') and (not in_quote)):
   char = ' '
  lastchar = char
  newline.append(char)
 return ''.join(newline)

def _replace_tab_with_space ( line , escapechar , quotechar ) : newline = [ ] in_quote = False lastchar = 'NONE' for char in line : if ( ( char == quotechar ) and ( lastchar != escapechar ) ) : in_quote = ( not in_quote ) if ( ( char == ' DCTB ' ) and ( not in_quote ) ) : char = ' ' lastchar = char newline . append ( char ) return '' . join ( newline )
replace tabs with spaces in given string .