I have a file containing lines like:
tree my_tree = ((t1:961.00,t2:902.00):961:00,t3:878:00);
which represents a tree structure with branch lengths. I want to multiply all branch lengths in each line, i.e. numbers after
:, by (preferably unique) random numbers between 0 and 1. Also it would be great if there is any random number generator utility in which the distribution can be specified, say normal with given mean and standard deviation.
I know how to generate random numbers with, say,
shuf whithin a specific range >1. I also know how to replace a regex with sed in file
sed -i 's/:[0-9\.]+/My_RANDOM_NUMBER/g' my_file. But I'm still struggling to achieve the task.