Removing spaces and empty lines from a file Using Python

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • salikhanan
    New Member
    • May 2012
    • 1

    Removing spaces and empty lines from a file Using Python

    Hello

    I have a file which contains a value 2000,00. but it contains spaces after 2000,00 and empty lines.

    I want to remove all the spaces and empty lines, If some one can give some Idea,

    Thanks
  • dwblas
    Recognized Expert Contributor
    • May 2008
    • 626

    #2
    Test for the length of record.strip(). Obviously, if the length equals zero it is an empty record.

    Comment

    Working...