Importing Data From Randomly Names Text Files + Array Question

eryksd

Board Regular
Joined
Jan 17, 2016
Messages
51
Hello,

Currently working on this problem, I think I'll be able to get through most of it, but have 2 main questions:

1. Is it possible to extract data from text files, if I don't know the text file names?
(Script will work with text files in the working directory, but the text files will always have random and different names when they are run. Not sure how I would reference them to pull out data).

2. Would the best approach to my problem be to create an array from the .txt data, to search through all the barcodes, and once a barcode is found, subtract "1" from the "Shipped" (quantity) of that barcode array entry, and keep searching through that record until "Shipped" quantity reaches "0"?
(Note: It doesn't matter in which order a 'barcode' is assigned to which 'Ship To' pile it'll go to, as long as each 'barcode' is assigned to one)
--------
Sample files I'll be working with (.txt input files):

Shipment Plan 1
Shipment Plan 2
Shipment Plan 3
Shipment Plan 4

--------

Here are some workflow diagrams that demonstrate what exactly I'm trying to do:

2vmy98o.jpg

2r6i3i1.jpg



Picture of "Shipping Plan" .txt file data (with relevant data in Bold):

11jllvo.jpg



Any help would be greatly appreciated! Still pretty new to arrays so just trying to rack my brain on how to tackle this problem :eek:
 

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.

Forum statistics

Threads
1,215,422
Messages
6,124,811
Members
449,191
Latest member
rscraig11

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top