Need to code this using python

This is the place for queries that don't fit in any of the other categories.

Need to code this using python

Postby user_name » Thu Oct 24, 2013 9:14 pm

I have one file which have repeated numbers in it (say one number coming three times).
I want to change the number when it appears second time and third time.

For example, I have a file like this.

A,1,3
A,2,3
A,2,4
A,2,11
A,3,7
A,4,5
A,4,13
A,4,7
A,5,11
A,5,13
A,7,8

In the above file, lets say 3 is coming three time, I want to replace the number 3 when it appears second time as 1003 and, when it appears third time then 10003.
So, like this I want to do this for all the numbers and the file size is very big.
I am really struggling with this to code it in python.
If anyone can help me in this then I will be really thankful to him and appreciate his contribution.
Thank you.
Last edited by micseydel on Thu Oct 24, 2013 9:25 pm, edited 1 time in total.
Reason: First post lock.
user_name
 
Posts: 1
Joined: Thu Oct 24, 2013 8:56 pm

Re: Need to code this using python

Postby stranac » Thu Oct 24, 2013 9:18 pm

user_name wrote:I am really struggling with this to code it in python.

Show us what you have tried, and we can work from there.

Here's a link that will tell you what your post needs to look like to get the best help possible:
viewtopic.php?f=6&t=145
Friendship is magic!

R.I.P. Tracy M. You will be missed.
User avatar
stranac
 
Posts: 1093
Joined: Thu Feb 07, 2013 3:42 pm


Return to General Coding Help

Who is online

Users browsing this forum: No registered users and 8 guests