Galera,
Tenho uma linha no meu arquivo txt que possui 21 campos, sendo 15 fixos e os 6 finais podem ser repeditos “N VEZES”.
Teria que quebrar a linha depois do campo 15 e fazer um loop para ler os dados do campo 16 ao 21.
Exemplo do arquivo:
03400296823881000004800200005C02968238810296845408000004800201322I0000239718000023971801000000100008000000000100000001010000002000000100000001000000010100000010001600000000010000000101000015900024000000000100000001040000124000240000000001000000010400000010000950000000010000000104000000100014500000000100000001040000013000000100000001000000010450000060002400000000010000000106000001300000000000000100000001061000015000000000000001000000010611000100000000000000010000000108000006000000000000000100000001091000007000000000000000000000000950000150000000000000000000000009510001400000000000000000000000
E teria que ficar assim:
(034)(002971228760000048001)(0)(0)(005)©(02971)(22876)(02971)(48041)(0000048001)(01998)(I)(0000209405)(0000209405)
(0100)(00006)(000000)(1)(00000001)(00000001)
(0100)(00184)(000270)(0)(00000001)(00000001)
(0100)(00001)(000005)(1)(00000001)(00000001)
(0400)(00145)(000270)(0)(00000001)(00000001)
(0400)(00001)(000170)(0)(00000001)(00000001)
(0400)(00001)(000100)(0)(00000001)(00000001)
(0400)(00006)(000000)(1)(00000001)(00000001)
(0450)(00011)(000270)(0)(00000001)(00000001)
(0600)(00011)(000000)(0)(00000001)(00000001)
(0610)(00005)(000000)(0)(00000001)(00000001)
(0800)(00043)(000000)(0)(00000001)(00000001)
(0920)(00002)(000000)(0)(00000000)(00000000)
(0950)(00007)(000000)(0)(00000000)(00000000)
Alguém tem idéia de como posso fazer isso?