Any Perl programmers here?

Man of Honour
Joined
21 Nov 2004
Posts
47,166
Hi all, as part of a project I am working on at the moment I am trying to do the following (below). Problem is, I haven't coded in Perl for years and years and am completely stuck! Any ideas? Any help would be hugely appreciated!

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.
 
What exactly are you having trouble with?

Opening the file? Storing the numbers?

What you've got there looks like a good bit of sudo code... why not just pad it out with some Google searches for each line?

Read file for each line in perl:
http://www.cs.cf.ac.uk/Dave/PERL/node241.html

Use regex in perl to find comma:
http://www.troubleshooters.com/codecorn/littperl/perlreg.htm

I do actually know a fair bit of Perl if you get super stuck but it's not going to help you in the long run if you have to support this code that you're developing if I just tell you what to write.

Hope that gets you in the right direction though.
Roy
 
What exactly are you having trouble with?

Opening the file? Storing the numbers?

What you've got there looks like a good bit of sudo code... why not just pad it out with some Google searches for each line?

Read file for each line in perl:
http://www.cs.cf.ac.uk/Dave/PERL/node241.html

Use regex in perl to find comma:
http://www.troubleshooters.com/codecorn/littperl/perlreg.htm

I do actually know a fair bit of Perl if you get super stuck but it's not going to help you in the long run if you have to support this code that you're developing if I just tell you what to write.

Hope that gets you in the right direction though.
Roy

Cheers, will have a crack at it and see how I get on!
 
Back
Top Bottom