User Profile

Collapse

Profile Sidebar

Collapse
shajias
shajias
Last Activity: Feb 20 '07, 05:21 AM
Joined: Nov 30 '06
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • shajias
    replied to How to strip of mulitiple white spaces.
    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...
    See more | Go to post

    Leave a comment:


  • shajias
    started a topic How to strip of mulitiple white spaces.

    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...
    See more | Go to post

  • 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 :-(
    See more | Go to post

    Leave a comment:


  • shajias
    started a topic How to remove the carriage returns from XML data.

    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
    ...
    See more | Go to post
    Last edited by shajias; Jan 11 '07, 10:26 AM. Reason: Making a change

  • shajias
    started a topic deleting a line from a file

    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')...
    See more | Go to post

  • shajias
    replied to HTML Parser doubt
    Putting in quotes wont work..... This scipt is a genric one which takes many files as input.... Issue here is whenever &le; and &ge; which stands for < and > the handle_data function in HTMLParser class strips those '<' and '>'
    See more | Go to post

    Leave a comment:


  • shajias
    replied to HTML Parser doubt
    Hi ,
    Any one has any clue about this one... i am in need of this info very urgently..... :-(
    See more | Go to post

    Leave a comment:


  • shajias
    started a topic HTML Parser doubt

    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 &lt;This&gt is an example which will read as <This> is an...
    See more | Go to post
No activity results to display
Show More
Working...