Awkard way to pharse it in the title ik. I’ll break it down better so that it makes sense. I have a file that says:
abab
baaa
babb
I need to read each character of a line into a register corresponding to its position in the line. So, starting with the first line, “abab”. “a” goes to register 1, “b” goes to register 2, “a” goes to register 3, “b” goes to register 4 and so on. Now for the second line, “baaa”, “b” gets appended to register 1, “a” gets appended to register 2. “b” is appended to register 3 and “a” is appended to register 4.
Doing that for all lines gives me four registers, corresponding to each character position.
#1: abb
#2: baa
#3: aab
#4: bab
Another thing worth noting is that I want to do that for multiple files with similar contents, so that in the end I have a register containing all the characters of the first position on the line, another with all the characters of the second position of the line and so on.
#1: abbababbab…..
#2: baababbabaa…
…
#n: babbabaaaaba…
can i do this in shell script or do I need dabble into some awking for that