Extract & Save Unknown Headers
Posted: Wed Oct 28, 2015 9:14 am
All,
I have a file with below format.
Header --> *H*
Detail
Trailer --> *T*
File should have,
*H*
<Country Name ....>
<Country Name ....>
*T*
I want to capture where Header <> *H* and Trailer <> *T*. The tricky thing is, I don't know what will come apart from *H* and *T*.
If I write like <> *H* , It will capture other records
Scenario 1:
Even I can't go with number of rows...Incase If I received file something like
*H*
#T*
#H#
*H#
I have to capture the remaining 3 records...
Scenario 2:
File has only 1 header, but it has
#H$
How should I identify this unknown header?
Inputs are welcome!
I have a file with below format.
Header --> *H*
Detail
Trailer --> *T*
File should have,
*H*
<Country Name ....>
<Country Name ....>
*T*
I want to capture where Header <> *H* and Trailer <> *T*. The tricky thing is, I don't know what will come apart from *H* and *T*.
If I write like <> *H* , It will capture other records
Scenario 1:
Even I can't go with number of rows...Incase If I received file something like
*H*
#T*
#H#
*H#
I have to capture the remaining 3 records...
Scenario 2:
File has only 1 header, but it has
#H$
How should I identify this unknown header?
Inputs are welcome!