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

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

P: 3
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
Aug 3 '09 #1
Share this Question
Share on Google+
4 Replies


P: 3
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
Aug 3 '09 #2

bvdet
Expert Mod 2.5K+
P: 2,851
Can you show us some effort to code this yourself? Python file methods deal in bytes, not bits.
Aug 3 '09 #3

Dheeraj Joshi
Expert 100+
P: 1,123
Got a doubt. Whether you want to consider the spaces or not.?
Aug 3 '09 #4

bvdet
Expert Mod 2.5K+
P: 2,851
Your question does not match your title. Could it be as simple as this:
Expand|Select|Wrap|Line Numbers
  1. f = open(your_file_name, 'r+')
  2. f.seek(10)
  3. f.write('+')
  4. f.close()
I suspect there is more to this question than what was explained.
Aug 4 '09 #5

Post your reply

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