I have a requirement in which i have to read a file which has multiple columns seperated by a pipe "|" from this i have to read each column values seperately and create a comma seperated row for the column and write to another file.
eg:
Input file:
ColA ColB
1 2
2 x
3 y
4 c
5 q
from this i have to create two filles, each having data as
file_colA:
1,2,3,4,5
file_colB:
2,x,y,c,q
i have created shell script using a for loop, which may take long time when i implement it in prod.
sorry for the wrong file
Input file:
ColA ColB
1|2
2|x
3|y
4|c
5|q
and it doesnt have column header.
thanks johnson for the approach, but it will try to read the file line by line, which i want to avoid. since in production i may have millions of records and this may cause a bottleneck.