JKwan
02-13-2016, 10:46 AM
snb - I am wondering if the below code can have multiple filter conditions?
Sub M_snb()
With createobject("scripting.filesystemobject")
.createtextfile("G:\OF\Filtered.csv").write join(filter(split(.opentextfile("G:\OF\sample.csv").readall,vbcrlf),"dd-mm-yyyy")),vbcrlf)
End With
workbooks.open "G:\OF\Filtered.csv"
End Sub
The filter for above is the date section, can I have another filtering criteria added to it? For example, if I wanted two dates on a "or" condition. How about "and" condition.
The main reason why I wanted this is that some of my SCADA file dump are really bastardize, so with the above code, I can extract my pertinent rows of information, however, I need multiple filter conditions - sometimes with "or" and "and".
Sub M_snb()
With createobject("scripting.filesystemobject")
.createtextfile("G:\OF\Filtered.csv").write join(filter(split(.opentextfile("G:\OF\sample.csv").readall,vbcrlf),"dd-mm-yyyy")),vbcrlf)
End With
workbooks.open "G:\OF\Filtered.csv"
End Sub
The filter for above is the date section, can I have another filtering criteria added to it? For example, if I wanted two dates on a "or" condition. How about "and" condition.
The main reason why I wanted this is that some of my SCADA file dump are really bastardize, so with the above code, I can extract my pertinent rows of information, however, I need multiple filter conditions - sometimes with "or" and "and".