python - Delete ^L character in a log file -
python - Delete ^L character in a log file -
this question has reply here:
remove specific characters string in python 12 answersi want delete characters "\l" find when read file. tried utilize function when read line:
def cleanstring(self, s): if isinstance(s, str): s = unicode(s,"iso-8859-1","replace") s=unicodedata.normalize('nfd', s) homecoming s.encode('ascii', 'ignore') but doesn't delete character. know how it?
i tried using replace function well, not better:
s = line.replace("\^l","") thanks answers.
probably have not literal characters ^ , l, displayed ^l.
this form feed character.
so s = line.replace('\x0c', '').
python unicode
Comments
Post a Comment