I've created a hash which looks as follows
keys values 5302 0 C 1 T 9046 0 G 1 A 11110 0 T 1 C 12640 0 T 1 C 18262 0 A 1 G 21994 0 A 1 G 25713 0 A 1 G 26638 0 T 1 G 28194 0 A 1 G 29841 0 G 1 A 30475 0 T 1 C 31503 0 A 1 C 32211 0 G 1 A 37138 0 G 1 A 41088 0 G 1 A 42626 0 A 1 G
using this I was hoping to replace values in another file which looks as so.
# ID 1005.csv 0 1 1 1 0 1 1 1 1 1 1 0 1 1 1 0 0 0 1... 0 1 1 1 0 1 1 0 1 1 1 0 0 0 0 0 1 1 0... # ID 1009.csv 0 1 1 1 0 1 1 1 1 1 1 0 1 1 1 0 0 0 1... 0 1 1 1 0 1 1 1 1 1 1 0 1 1 1 0 0 0 1... etc...
each line of the hash represents the values of the file i want to alter in order i.e. the first line of the hash represents the first value in each line, the second line of the hash represents the second value in each line.
What I would like to achieve is at each position of each line replace the value (either 1 or 0) with the letter code that is represented by it's related line on the hash.
I've been bashing at this for days without any luck.
In reply to Using Hashes to replace values by b00mIR
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |