11-16-2010, 06:09 PM
thanks a lot for your help
I have two additional questions
how do I get the folder name instead of the folder path
and how to I I find files across multiple directories
this is what I have sofar
I have two additional questions
how do I get the folder name instead of the folder path
and how to I I find files across multiple directories
this is what I have sofar
str s
if(!BrowseForFolder(s)) ret
out s
ICsv x=CreateCsv(1)
x.ColumnCount=4
str f
str _ug
str _ugDate
str _ugTime
str _line
str _sData
str _patternug="ug::[^\n]*"
str _patternDate="\d\d\d\d-\d\d-\d\d"
str _patternTime="\d\d:\d\d:\d\d"
foreach f s
,f+iif(f.end("\") "*" "\*")
,Dir d
,foreach(d f FE_Dir 0x6)
,,str _sPath=d.FileName(1)
,,_sData.getfile(_sPath)
,,str _sFolder.getpath(_sPath "")
,,out _sPath
,,foreach _line _sData
,,,if(findrx(_line _patternug 0 2 _ug)>=0)
,,,,findrx(_line _patternDate 0 2 _ugDate)
,,,,findrx(_line _patternTime 0 2 _ugTime)
,,,,;add empty row and use Cell
,,,,int r=x.AddRowMS(-1)
,,,,x.Cell(r 0)=_sFolder; x.Cell(r 1)=_ugDate; x.Cell(r 2)=_ugTime; x.Cell(r 3)=_ug
out x
str _filename = "$desktop$\data.csv"
x.ToFile(_filename)