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 answers

i 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

Popular posts from this blog

model view controller - MVC Rails Planning -

ruby on rails - Devise Logout Error in RoR -

html - Submenu setup with jquery and effect 'fold' -