![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Morning, Is there a way to import a text fie when you only know part of the file name? What I have is a file that changes dynamically based on the date and time. I will only have the date. The time always changes. I know how to pull the date as part of a text file dynamically: '************************************************* ********************* ' Visual Basic ActiveX Script '************************************************* *********************** ' Pkg 200 Option Explicit Function Main() Dim oConn, sFilename ' Filename format - doors_IR_yyyymmdd_hhmiss.txt sFilename = "doors_IR_" & Year(Now()) If Month(Now()) < 10 Then sFilename = sFilename & "0" & _ Month(Now()) Else sFilename = sFilename & Month(Now()) If Day(Now()) < 10 Then sFilename = sFilename & _ "0" & Day(Now()) Else sFilename = sFilename & Day(Now()) sFilename = DTSGlobalVariables("LogFilePath").Value & _ sFilename & ".txt" Set oConn = DTSGlobalVariables.Parent.Connections("Text File (Source)") oConn.DataSource = sFilename Set oConn = Nothing Main = DTSTaskExecResult_Success End Function What do I add to say give me anything that looks like doors_IR_todaysDate_*.txt? Thanks |
#3
| |||
| |||
|
#4
| |||
| |||
|
|
No there could be multiple files. Is there someway you can say show me anything in the folder that starts with doors_ir_20060904_ (where 20060904 is todays date and) ends in ..txt? Because the structure of the file name changes everytime it's put out there, for example it can say doors_IR_20060904_090829_AM.txt one time and doors_IR_20060904_131129_PM.txt the next. The only thing I can say with certainty is the first three sections.The next two are the time and whether it is AM or PM. The files run whenever someone gets the urge to send them. There is no set time. |
#5
| |||
| |||
|
![]() |
| Thread Tools | |
| Display Modes | |
| |