Captainrave
Technical User
It has been a while since I have coded anything and I need help. I always seem to find the answers here, and you are all much more skilled than I am!
So I have a file that has a list of numbers like so (in csv format):
2923044 2924240
2926739 2928907
2935683 2936888
2939169 2940560
2941959 2942579
I then want to locate these numbers in another file that is in the format:
CDS 1..1920
/product="tRNA uridine 5-carboxymethylaminomethyl odification enzyme GidA"
/protein_id="NP_878920.1"
CDS 2000..2450
/product="tRNA uridine 5-carboxymethylaminomethyl odification enzyme GidB"
etc...
Basically everytime it finds one of these numbers I need it to pull out the information contained within the " and " of /product. Note that there may be other fields between CDS and product, however only ONE /product will be found for each set of numbers found.
I then need these output as a list like:
2923044 2924240 Productname from /product"name"
2926739 2928907 Productname from /product"name" etc...
I also need the script to ASK for the name of the file to be input and the name of the output file! Ideally the output would be csv.
So I have a file that has a list of numbers like so (in csv format):
2923044 2924240
2926739 2928907
2935683 2936888
2939169 2940560
2941959 2942579
I then want to locate these numbers in another file that is in the format:
CDS 1..1920
/product="tRNA uridine 5-carboxymethylaminomethyl odification enzyme GidA"
/protein_id="NP_878920.1"
CDS 2000..2450
/product="tRNA uridine 5-carboxymethylaminomethyl odification enzyme GidB"
etc...
Basically everytime it finds one of these numbers I need it to pull out the information contained within the " and " of /product. Note that there may be other fields between CDS and product, however only ONE /product will be found for each set of numbers found.
I then need these output as a list like:
2923044 2924240 Productname from /product"name"
2926739 2928907 Productname from /product"name" etc...
I also need the script to ASK for the name of the file to be input and the name of the output file! Ideally the output would be csv.