473,324 Members | 2,166 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

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
May 29 '12 #1
1 2015
dwblas
626 Expert 512MB
Test for the length of record.strip(). Obviously, if the length equals zero it is an empty record.
May 29 '12 #2

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

Similar topics

1
by: Serge Guay | last post by:
I have been trying to print a text file to my printer but the most I have been able to do is print one line. I have been using the following commands. dc = win32ui.CreateDC()...
2
by: adityabhambri | last post by:
HI guys, I am trying to automate some project work which the accounting dept of the company uses. They have to go through multiple steps to achieve the final goal. Is there some way that I can use...
1
by: Denton | last post by:
Hi all: I working in MS window environment. Now I want to use a python script to import some data from CSV file to MDB file. but I have some problems about creating MDB file in DAO. I am using...
0
by: psbasha | last post by:
Hi, Is there any module available to write and read a XML file using Python? Links for the material will help me. Thanks in advance PSB
7
by: parthpatel | last post by:
Hello, I m trying to convert a xls file data into csv type data. Is it possible anyway that i can do this using python coding if yes than plz provide a demo code for this Thanks
8
by: fahadqureshi | last post by:
Hello, I posted here before asking a question about reading excel. Now that the reading problem is solved i am having trouble on how to write to an excel file. This was my code to read the excel...
3
by: sophie_newbie | last post by:
Is there any way to do this directly within python? If not is there any other good way to achieve it? Thanks in advance for any help!
4
by: Dilip1983 | last post by:
Hi Gurus, The data in the file looks like in this format 1 2233|A.K Shukla |G.M |Sales |12/12/52|6000 2 9876|Jai Sharma |Director |Production...
10
by: pikkukoira | last post by:
Good day. I have series of data in cvs file like below, 1,,, 1,137.1,1198,1.6 2,159,300,0.4 3,176,253,0.3 4,197,231,0.3 5,198,525,0.7
1
by: new one | last post by:
i want to convert a html file to dom using python
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.