I am tring to separte the filed by comma. Is there a way to add a commas to the following lines:
If line start with H then add commas to the lines
H9806201A2472352005040120050401000000000000000000000 H,9806201,A247235,20050401,200504010,00000000000000000000 If line start with D then insert commas
DAC237823V3103X 00224522033240 00000100000063160000000000063160 14
D,AC237823,V3103,X00224522033240, 000001,000000631,60000000000063,160 14
and this is my input file:
H9806201A2472352005040120050401000000000000000000000
DAC237823V3103X 00224522033240 00000100000063160000000000063160 14
DAC237823V3103X 00234522033240 00000100000063160000000000063160 14
H9806201O4713392005040120050401000014500001280000081
D8CJL1147V3003X 00234420047060 00000100001045950000000001045950 14
H9806201O4713612005040120050401000088100008810000762
D8CJG1118TS0503 00022330019295 00000100000014970000000000014970 14
D8CJG1118TS0503 0031161006934583 00000200000054620000000000109240 14
D8CJG1118TS0503 00453121035110 00000100000034690000000000034690 14
If line start with H then add commas to the lines
H9806201A2472352005040120050401000000000000000000000 H,9806201,A247235,20050401,200504010,00000000000000000000 If line start with D then insert commas
DAC237823V3103X 00224522033240 00000100000063160000000000063160 14
D,AC237823,V3103,X00224522033240, 000001,000000631,60000000000063,160 14
and this is my input file:
H9806201A2472352005040120050401000000000000000000000
DAC237823V3103X 00224522033240 00000100000063160000000000063160 14
DAC237823V3103X 00234522033240 00000100000063160000000000063160 14
H9806201O4713392005040120050401000014500001280000081
D8CJL1147V3003X 00234420047060 00000100001045950000000001045950 14
H9806201O4713612005040120050401000088100008810000762
D8CJG1118TS0503 00022330019295 00000100000014970000000000014970 14
D8CJG1118TS0503 0031161006934583 00000200000054620000000000109240 14
D8CJG1118TS0503 00453121035110 00000100000034690000000000034690 14