; Requires FileIO, CSV, and TimeDiff UDFs
; Pseudo-code - untested - CONFIRM ALL COMMAND SYNTAX!!
Dim $aOut[6] ; need 7 fields to output - change as desired
$ = Open(2, '.\dstfile.csv', 5)
;Load the source data into an array
$aSrcData = FileIO('.\srcfile.txt', 'R')
; Read each line, convert it to an array
For Each $Line in $aSrcData
; break line into array based on tabs
$aLine = Split($Line, Chr(9))
; Re-init the output array
ReDim $aOut[6]
; Load the 7 desired output fields from the input line array
; Change the number of fields and field IDs as needed
$aOut[0] = $aLine[21] ; date field
$aOut[1] = $aLine[3]
$aOut[2] = $aLine[4]
$aOut[3] = $aLine[7]
$aOut[4] = $aLine[8]
$aOut[5] = $aLine[9]
$aOut[6] = $aLine[12]
; Now is the time to do any data manipulation to your data...
; reformat the date value to use the standard format YYYY/MM/DD
$aTmp = Split($aOut[0], '.')
$aOut[0] = $aTmp[2] + '/' + $aTmp[1] + '/' + $aTmp[0]
; Get age of record in Days
$Age = TimeDiff($aOut[0], , 'D')
; Process this line if it is less than 30 days old. $Days will contain a decimal value
; containing the age as whole and fractional days. (ie 3 days 8 hours will be 3.333)
If $Age <= 30
; Now that you have the OUT array for the current line, output it as CSV
$Rc = WriteLine(2, CSV($aOut))
EndIf
Next