Code:
$SearchData = 'objtype'           ; insert when line containing this is found
$RootPath = 'c:\test\sosi\' ; root path where files live
$Files = DirList($RootPath, 6) ; return a list of all files with complete paths

For Each $File In $Files
  $kommunenr = SubStr ("$file", 14,2)   ; extract "county"-number from filename
  $InsertData = '..KOMMUNE $kommunenr'     ; data line to insert
   Move $File 'WorkFile.tmp' ; rename the file
    If Open(2, 'workfile.tmp')=0
      $ = RedirectOutput($File) ; output to original file
      $Line = ReadLine(2)
      While NOT @ERROR
        If InStr($Line, $SearchData)
          $InsertData ?        ; output extra (inserted) line
        EndIf
      $Line ?                  ; output original line
      $Line = ReadLine(2)
      Loop
      $ = Close(2)
      $ = RedirectOutput('')  ; close output file
      Del 'workfile.tmp'
    EndIf
Next


This is how the script looks so far. Right now the files is extracted in an explicit dir, and the script handles all files here, inserting a line, including some text and the two first chars of the filename for each hit on specific text.

I will next start expanding the script, trying to implement files to be processed from different directories, and look into the possibility to handle the unzipping as well

Jon
_________________________
I was placed on earth to do a job. Right now I have so much to do, I will never die..