473,394 Members | 1,800 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,394 software developers and data experts.

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
Aug 3 '09 #1
4 1541
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
2,851 Expert Mod 2GB
Can you show us some effort to code this yourself? Python file methods deal in bytes, not bits.
Aug 3 '09 #3
Dheeraj Joshi
1,123 Expert 1GB
Got a doubt. Whether you want to consider the spaces or not.?
Aug 3 '09 #4
bvdet
2,851 Expert Mod 2GB
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

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

Similar topics

1
by: Luke Dalessandro | last post by:
I have an application where there is a primary XML data file. I'll use the following as an example: <data> <item id="a"> <name>A</name> <price>$10</price> </item> <item id="b">...
6
by: vigi98 | last post by:
Hello all, Can someone confirme that this: var strURLpiece = "UK & Ireland"; strURLpiece.replace("&", "%26"); replaces all occurrence of the character & by %26 in strURLpiece, ie that...
6
by: Marty | last post by:
Hi, I would like to replace "\r\n" by "_" within a specific string. I tried : strMyString.Replace('\r', '_'); strMyString.Replace('\n', '_'); or...
1
by: namemattersnot | last post by:
Here's my code: ### myvar = "test1_1;test2_1;test3_1"; myvar = myvar.replace(/_1/g, "_2")'; ### it works just fine. if I introduce "cat = 1", how do I change my replace function so that...
0
by: Rave | last post by:
This is a long shot, but I thought I'd try it. I am currently using excel as an inventory tool. I currently have a hand-held scanner plugged into a laptop for reading barcodes. Using the "Find and...
2
by: John Nagle | last post by:
I'm trying to clean up a bad ASCII string, one read from a web page that is supposedly in the ASCII character set but has some characters above 127. And I get this: File...
1
by: jx2 | last post by:
lets say i've got a str="john michael luise+marry" i need to replace all ocurrance of name with name+surname eg str2= "johnBrown michealBrown luiseBrown+marryBrown" i gues i need something like...
2
by: Mukesh_Singh_Nick | last post by:
What is meant by the "most significant digits" in the following statement? <BLOCKQUOTE> With %g and %G, the precision modifier determines the maximum number of significant digits...
5
by: Curious | last post by:
I have: if (temp.Contains("Account") == true) { temp.Replace("Account", "Client"); } The "Account" is not replaced by "Client" after this operation. I used
8
by: bsonline | last post by:
I want to replace + sign with 2 blackslash and 1 + sign (\\+)... when I use the replaceAll()... It throws a 500 status error like "java.util.regex.PatternSyntaxException: Dangling meta character...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.