I have a text file with four summary headers and one detail block of data labelled "DELIVERY DATA". These are separated by open lines.
This text file is downloaded from the mainframe in exactly the same format every time.
Please help me with a working sample of VBA code to automate the selection and importing of the "DELIVERY DATA" block of text only into an MS Access table.
I have browsed all the threads in this regard without any satisfaction. Is anyone willing to supply me with the specific code for the text file as outlined below.
The text file is called import.txt and an abbreviated version looks like this:
UNIT SUMMARY,UNIT,BUNDLES,TONS
,041,17, 507.100
,040,10, 234.200
,042,1, 29.250
,*,43, 1287.450
,053,15, 421.350
,014,40, 866.000
SEASON SUMMARY,SEASON,,TONS FIBRE,TONS MOISTURE,TONS CANE
, 2002,, 903.409, 4391.032,6310.200
MONTHLY SUMMARY,SEASON,MONTH,FIBRE,MOISTURE,TONS
, 2002, 2, 216.460, 968.095, 1391.100
, 2002, 3, 215.195, 1019.123, 1456.750
, 2002, 4, 206.244, 1032.628, 1493.300
, 2002, 5, 265.509, 1371.186, 1969.050
WEEKLY SUMMARY,SEASON,WEEK,FIBRE,MOISTURE,TONS
, 2002, 8, 67.121, 290.745, 419.200
, 2002, 9, 149.339, 677.350, 971.900
, 2002, 10, 136.685, 648.193, 925.300
, 2002, 11, 78.510, 370.929, 531.450
, 2002, 17, 54.913, 280.592, 405.300
, 2002, 18, 151.331, 752.036, 1088.000
, 2002, 19, 139.831, 733.469, 1045.700
, 2002, 20, 125.678, 637.718, 923.350
DELIVERY DATA,SEASON,WEEK,DATE,VOUCHER,TONS
,2002,8,18-04-2002 12:22:52,B170485, 27.300
,2002,8,18-04-2002 17:22:05,B170786, 28.250
,2002,8,19-04-2002 01:36:21,B170787, 29.300
,2002,8,19-04-2002 03:00:21,B170788, 29.900
,2002,8,19-04-2002 05:30:26,B170789, 28.300
,2002,8,19-04-2002 13:13:52,B170790, 28.400
,2002,8,19-04-2002 16:23:44,B170791, 28.250
Thanks in anticipation,
Howard
This text file is downloaded from the mainframe in exactly the same format every time.
Please help me with a working sample of VBA code to automate the selection and importing of the "DELIVERY DATA" block of text only into an MS Access table.
I have browsed all the threads in this regard without any satisfaction. Is anyone willing to supply me with the specific code for the text file as outlined below.
The text file is called import.txt and an abbreviated version looks like this:
UNIT SUMMARY,UNIT,BUNDLES,TONS
,041,17, 507.100
,040,10, 234.200
,042,1, 29.250
,*,43, 1287.450
,053,15, 421.350
,014,40, 866.000
SEASON SUMMARY,SEASON,,TONS FIBRE,TONS MOISTURE,TONS CANE
, 2002,, 903.409, 4391.032,6310.200
MONTHLY SUMMARY,SEASON,MONTH,FIBRE,MOISTURE,TONS
, 2002, 2, 216.460, 968.095, 1391.100
, 2002, 3, 215.195, 1019.123, 1456.750
, 2002, 4, 206.244, 1032.628, 1493.300
, 2002, 5, 265.509, 1371.186, 1969.050
WEEKLY SUMMARY,SEASON,WEEK,FIBRE,MOISTURE,TONS
, 2002, 8, 67.121, 290.745, 419.200
, 2002, 9, 149.339, 677.350, 971.900
, 2002, 10, 136.685, 648.193, 925.300
, 2002, 11, 78.510, 370.929, 531.450
, 2002, 17, 54.913, 280.592, 405.300
, 2002, 18, 151.331, 752.036, 1088.000
, 2002, 19, 139.831, 733.469, 1045.700
, 2002, 20, 125.678, 637.718, 923.350
DELIVERY DATA,SEASON,WEEK,DATE,VOUCHER,TONS
,2002,8,18-04-2002 12:22:52,B170485, 27.300
,2002,8,18-04-2002 17:22:05,B170786, 28.250
,2002,8,19-04-2002 01:36:21,B170787, 29.300
,2002,8,19-04-2002 03:00:21,B170788, 29.900
,2002,8,19-04-2002 05:30:26,B170789, 28.300
,2002,8,19-04-2002 13:13:52,B170790, 28.400
,2002,8,19-04-2002 16:23:44,B170791, 28.250
Thanks in anticipation,
Howard