Menu

pyparsing moduleto remove unwanted characters

paulb
2009-10-03
2013-05-14
  • paulb

    paulb - 2009-10-03

    Hi,
      Can I use pyparsing to remove unwanted characters from a string.  For example I have an xml message that I need to parse with characters like u'\u25c4'.  I cant seem to print these characters so can I remove these characters?  Use something other than pyparse?

     
  • Paul McGuire

    Paul McGuire - 2009-10-03

    You could, but I should think that this would be far simpler in straight Python, something like:

        infile = open(htmlsource)
        src = list(infile.read())
        filtered =
        open(outfile,"w").write("".join(filtered))

    No?

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.