Since I couldnt retain the format which I wanted in the mail, I am rewording my question.
Hi all,
I am having adjacent multiple white spaces(both leading, trailing and in the middle) in a string. I want to strip off all the multiple white spaces and need to substitute multiple whitespaces by one white space there. Is there any way for that.?
I know that leading and trailing whitespaces can be stripped...
User Profile
Collapse
-
How to strip of mulitiple white spaces.
Hi all,
Suppose I am having a string like this.
mystr = " I have five spaces after this and 3 spaces after this and 10 spaces after this. How to remove this muliple whitespaces "
I just want to remove this multiple whitespaces and need the output like this
I have five spaces after this and 3 spaces after this and 10 spaces after this. How to remove this... -
Thanks,
but unfortunately this data is not explicitly provided with '\n' . Some other form of carriage return is present which I am not able to strip of. I have checked the data in text pad also , there is no explicit '\n' given :-(Leave a comment:
-
How to remove the carriage returns from XML data.
Hi,
I am having a xml code like this
<name>
I am having a carriage return here.
Second line with carriage return.
This is the last line.
</name>
I am using xml.parsers.exp at for parsing the above mentioned xml
Is there any way to strip of all the carriage returns and get the data as
I am having a carriage return here. Second line... -
deleting a line from a file
Hi,
Just wondering whether I can open a file, read it , and if I come across a certain line, delete it then and there with the same file pointer. I know its possible to create a new file and copy the contents without this particular lien.. But just wondering whether its possible to do with one ptr itself...
input = open(r'c:\myfil e.txt','r')
L = input.readlines ()
input.close()
output = open(r'c:\myfil enew.txt','w')... -
Putting in quotes wont work..... This scipt is a genric one which takes many files as input.... Issue here is whenever ≤ and ≥ which stands for < and > the handle_data function in HTMLParser class strips those '<' and '>'Leave a comment:
-
Hi ,
Any one has any clue about this one... i am in need of this info very urgently..... :-(Leave a comment:
-
HTML Parser doubt
Hi ,
I am trying to parse HTML data and retrive the contents. I am facing a problem which I have explained below.
I have imported HTMLParser class and using the handle_data function. The issue here is the '<' and '>' data which is represented as &le and &ge is getting stripped off.
For eg: if the html representation is like <This> is an example which will read as <This> is an...
No activity results to display
Show More
Leave a comment: