I want to import a text file (fixed column length) with lines of multiple formats.
This file has one header line that has the number of records of each format.
e.g
Header line: 10 11 12
This header line says to us that follow 10 lines of format A, 11 lines of format B and 12 lines of format C
Lines 2-11 have the format A
Lines 12-22 have the format B
Lines 23-32 have the format C
Is there any sample code that imports such a file?
I already though of an algorithm that does this but I think that someone else might already has programmed something like this.
Algorithm
---------
Read the first line and retrieve the number of records of each format
Read the lines 2-11 and put them in a file A.txt
Read the lines 12-22 and put them in a file B.txt
Read the lines 23-32 and put them in a file C.txt
Import the 3 files in seperate tables based on different import specification
This file has one header line that has the number of records of each format.
e.g
Header line: 10 11 12
This header line says to us that follow 10 lines of format A, 11 lines of format B and 12 lines of format C
Lines 2-11 have the format A
Lines 12-22 have the format B
Lines 23-32 have the format C
Is there any sample code that imports such a file?
I already though of an algorithm that does this but I think that someone else might already has programmed something like this.
Algorithm
---------
Read the first line and retrieve the number of records of each format
Read the lines 2-11 and put them in a file A.txt
Read the lines 12-22 and put them in a file B.txt
Read the lines 23-32 and put them in a file C.txt
Import the 3 files in seperate tables based on different import specification