need to replace the digits with "+" sign inthe file

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • umarajeswari
    New Member
    • Mar 2007
    • 3

    need to replace the digits with "+" sign inthe file

    Hi,

    my question is ,


    say i have file in this following path /tmp/usubramani/hsbc/inbound/cambio3.txt

    1234 4567 678905678


    1.i have to read the file path
    2.i have to open an file
    3.find the 10th bit position
    4.replace the 10th bit position with the "+" operators
    5.close the file


    Thanks
    uma
  • umarajeswari
    New Member
    • Mar 2007
    • 3

    #2
    Hi,

    my question is ,


    say i have file in this following path /tmp/usubramani/hsbc/inbound/cambio3.txt

    1234 4567 678905678


    1.i have to read the file path
    2.i have to open an file
    3.find the 10th bit position
    4.replace the 10th bit position with the "+" operators
    5.close the file


    Thanks
    uma

    Comment

    • bvdet
      Recognized Expert Specialist
      • Oct 2006
      • 2851

      #3
      Can you show us some effort to code this yourself? Python file methods deal in bytes, not bits.

      Comment

      • Dheeraj Joshi
        Recognized Expert Top Contributor
        • Jul 2009
        • 1129

        #4
        Got a doubt. Whether you want to consider the spaces or not.?

        Comment

        • bvdet
          Recognized Expert Specialist
          • Oct 2006
          • 2851

          #5
          Your question does not match your title. Could it be as simple as this:
          Code:
          f = open(your_file_name, 'r+')
          f.seek(10)
          f.write('+')
          f.close()
          I suspect there is more to this question than what was explained.

          Comment

          Working...