Could you please help me here. I have a requirement to split filename and sate in two variables and if the date part is yyyy_m_d_time or yyyy_mm_d_time or yyyy_m_dd_time or yyyy_mm_dd_time it should be converted to yyyymmdd format.
Original File: DailyReportCompletedAJKGFPD_2020_7_21_2252.xlsx
Text portion : DailyReportCompletedAJKGFPD
Date portion : 202003042252
Original File: DailyReportCompletedAJKGFPD_2020_11_5_2252.xlsx
Text portion : DailyReportCompletedAJKGFPD
Date portion : 202003042252
Original File: DailyReportCompletedAJKGFPD_2020_12_25_2252.xlsx
Text portion : DailyReportCompletedAJKGFPD
Date portion : 202003042252
Original File: DailyReportCompletedAJKGFPD_2020_5_3_2252.xlsx
Text portion : DailyReportCompletedAJKGFPD
Date portion : 202003042252
Thanks for the reply. I do see the output for test portion and date portion remains same from different excel files given as input. It looks something is overriding in the loop.
Original File: DailyReportCompletedJKGFPD_2020_7_21_2253.xlsx
Text portion : DailyReportCompletedJKGFPD
Date portion : 202007212253
Original File: DailyReportCompletedAKGFPD_2020_11_5_2242.xlsx
Text portion : DailyReportCompletedAKGFPD
Date portion : 202011052242
Original File: DailyReportCompletedAJGFPD_2020_12_25_2152.xlsx
Text portion : DailyReportCompletedAJGFPD
Date portion : 202012252152
Original File: DailyReportCompletedAJKGPD_2020_5_3_2252.xlsx
Text portion : DailyReportCompletedAJKGPD
Date portion : 202005032252
Sorry to trouble again. Can we replace the file names with network location from the above code like $orgPath = 'C:\TEMP\Excel' to check the history loads
One more thing. what if the date separator changes from ‘_’ to ‘-’ can we handle it from the above code. Looking for reusability and handle mutiple format scenarios. In the network drive.