Firstly Seasonal Greetings to all!
Trying to automate a weekly data extraction task.
I want to concatenate data from Five daily emails I receive into a single file with some data formatting (code for this is removed as I know it works). I appear to have two errors that I cannot solve.
1)
I assumed that this would be applied to ALL occurrances in the list entry, but only does the first one, thereby having to put this code in a small loop to get ALL occurences done. "<SPACE>" used to clarify the spaces in the *stritran_multi* command.
2) each WRITE_LINE is writing 1 CRLF() to the beginning and end of each record so I have a blank line after each line of data.
anyone got a work around for this?
Trying to automate a weekly data extraction task.
I want to concatenate data from Five daily emails I receive into a single file with some data formatting (code for this is removed as I know it works). I appear to have two errors that I cannot solve.
1)
Code:
text = *for_each(tag,stritran_multi(tag,"[COLOR="#0000FF"]<space><space>[/COLOR]","[COLOR="#0000FF"]<space>[/COLOR]"),text)
2) each WRITE_LINE is writing 1 CRLF() to the beginning and end of each record so I have a blank line after each line of data.
anyone got a work around for this?
Code:
dim defdir as c = "c:\my databases\aviation\g-info\\" dim write_to_file as c = "g_info_updates.txt" dim header_text as c = "ModeS Reg MSN Type Action Date Notes" dim filelist as c filelist = filefind.get(defdir-"g-info changes*.txt",0,"PN") fpw = file.open(defdir-write_to_file,FILE_RW_SHARED) fpw.write_line(header_text) FOR each tag in filelist fp = file.open(tag,file_ro_shared) WHILE .not. fp.eof() text = fp.read_line() IF ut(text) <> "" THEN [COLOR="#FF0000"]FOR x = 1 TO 4 text = *for_each(tag,stritran_multi(tag," "," "),text) NEXT x[/COLOR] IF regex_match(left(text,6),"[[:xdigit:]]{6}","egi") THEN ' data formatting code removed [COLOR="#FF0000"] fpw.write_line(text) [/COLOR] END IF END IF END WHILE fp.close() next fpw.flush() fpw.close()
Comment