[CLOSED] How skip the first n lines on a flat file
I have a flat file that I want to read, but start the read at line 5 of the file, is this possible on the meta definition?
The first 4 lines contain header information that is not delimited. Here is what I currently have:
FILE=ff_uhro_backgroundchecks, SUFFIX=DFIX, REMARK='background checks per day per store'
SEGNAME=ROOT_SEG, SEGTYPE=S1, $
FIELD=DELIMITER, ALIAS=|, USAGE=A1, ACTUAL=A1, $
FIELD=STORE_NUM, ALIAS=STORE_NUM, USAGE=I4L, ACTUAL=A4, DESCRIPTION='Store Number', $
FIELD=CHECK_DATE, ALIAS=CHECK_DATE, USAGE=YYMD, ACTUAL=A8, DESCRIPTION='Date', $
FIELD=CHECK_COUNT, ALIAS=FILE_NAME, USAGE=A4, ACTUAL=I4, DESCRIPTION='Number of Background checks ran that day', $
This message has been edited. Last edited by: <Kathryn Henning>,
WF 7.6
November 06, 2014, 03:20 PM
Alan B
John,
Firstly, I think CHECK_COUNT has the incorrect ACTUAL & USAGE. Should the line be:
FIELD=CHECK_COUNT, ALIAS=FILE_NAME, USAGE=I4, ACTUAL=A4, DESCRIPTION='Number of Background checks ran that day', $
with the ACTUAL & USAGE reversed.
OK. As the heading lines are not delimited, all you need to know is the maximum length of the longest heading lines. For this example I use 80 characters, but almost anything above the maximum heading length will do:
FILE=ff_uhro_backgroundchecks, SUFFIX=DFIX, REMARK='background checks per day per store'
SEGNAME=ROOT_SEG, SEGTYPE=S1, $
FIELD=STORE_NUM, ALIAS=STORE_NUM, USAGE=I4L, ACTUAL=A80, DESCRIPTION='Store Number', $
FIELD=CHECK_DATE, ALIAS=CHECK_DATE, USAGE=YYMD, ACTUAL=A8, DESCRIPTION='Date', $
FIELD=CHECK_COUNT, ALIAS=FILE_NAME, USAGE=I4, ACTUAL=A4, DESCRIPTION='Number of Background checks ran that day', $
use the ACTUAL in STORE_NUM to be the maximum length.