I have an array like this I use
inputx.scan(/.*?\n/)
for create array this is a representation of my array
element 1 => [car;dog;soda]
element 2 => [bunny;pc;laptop]
element 3 => [hand;sword;shield]
this is my text file I use scan method for create array inputx.scan(/.*?\n/)
car;dog;soda
bunny;pc;laptop
hand;sword;shield
I need to replace each comma by number of array for obtain this
this is my expected output
in this output I replace ";" by "nthelementnumber;" example 1;
car1;dog1;soda
bunny2;pc2;laptop
hand3;sword3;shield
Please help me