By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
464,712 Members | 1,466 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 464,712 IT Pros & Developers. It's quick & easy.

Removing spaces and empty lines from a file Using Python

P: 1
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
May 29 '12 #1
Share this Question
Share on Google+
1 Reply

Expert 100+
P: 626
Test for the length of record.strip(). Obviously, if the length equals zero it is an empty record.
May 29 '12 #2

Post your reply

Sign in to post your reply or Sign up for a free account.