Dear Forum Members,
I have a requirement where I copy content from one excel sheet and transpose it to another excel sheet. While pasted data into one of the column example Column A - i want to paste the text from the soure filename. The rule of this text extraction (from the source filename) is below:
At the moment, I am using below code to populate the Column A with the filename (Fname). But the problem is - it is pasting the whole directory path of the path.I receive files with three different naming convention. I want to extract string from the filename to identify the from where orders are coming to me.
a. For Filename "ORD Load ORDERS - ORD-DL-LOND-003.xls" -- (If the filename contains DL, I need to extract “ORD-DL-LOND-003” from the filename and put into column A)
b. For Filename "ORD-OL-003 (SWA 10.16).xls" -- (If the filename contains OL, I need to extract “ORD-OL-LOND-003(SWA 10.16)” from the filename and put into column A)
c. For Filename "ORD Load ORDERS - ORD-OFF-002.xls" -- (If the filename contains OFF, I need to extract “ORD-OFF-002” from the filename and put into column A)
Fname - is the variable which contains the whole path of the source file.Please Login or Register to view this content.
Any help would be appreciated. Thanks.
Bookmarks