Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Grabbing a number and counting letters...

Status
Not open for further replies.

Captainrave

Technical User
Nov 16, 2007
97
0
0
GB
Hi all, it has been a long while since I have needed to do any Perl coding! How easy is the following to do? For once I have a good idea what I need to do (makes a change), but this time I have forgotten HOW to do it.

Code:
File 1 (csv file), for each line: store the number in column 4 (lets call it X)


Goto File 2 (.txt and a long string of letters), count each character until X is found.
At X, add 1 and count how many characters until TAG, TAA or TGA are reached (call this Y).
At X, add 2 and count how many characters until TAG, TAA or TGA are reached (call this Z).
Add Y and Z to new columns in File 1 at the end of the line where X was found.
Goto back to File 1, goto the next line and repeat.

Any ideas?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top