Syntap Software Forum Forum Index Syntap Software Forum

 
 FAQFAQ   SearchSearch  UsergroupsUsergroups   RegisterRegister  ProfileProfile    Log inLog in 
 

Feature request: Merge several SA2 Files

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Syntap Software Forum Forum Index -> General
View previous topic :: View next topic  
Author Message
Fabrice
Pro


Joined: 02 Feb 2004
Posts: 14

PostPosted: Tue Oct 10, 2006    Post subject: Feature request: Merge several SA2 Files Reply with quote

Hi,

Is there a simple way to merge severall SA2 files in one ???
Like the Merge function, but where you can select several files.

As I keep all my logs in files by day, it can help me to merge files for one or more weeks in one file, export it in Excel and then work on it (search, sort, sum...)

Hope it will possible soon.


Really good product, I stille in love with it and hope also and API soon...
Back to top
View user's profile Send private message
syntap
Site Admin


Joined: 09 Sep 2003
Posts: 132

PostPosted: Tue Oct 10, 2006    Post subject: Reply with quote

Sure... the way I do this is create an empty project file, then use File -> Append Log to bring in each file I want. Control-A is the keyboard shortcut so create a blank project, hit Control-A, browse to a file you want to include. Hit Control-A for the next one, etc.
Back to top
View user's profile Send private message Send e-mail
Fabrice
Pro


Joined: 02 Feb 2004
Posts: 14

PostPosted: Wed Oct 11, 2006    Post subject: An AutoIt help... Reply with quote

Hi syntap

This is a script I done yesterday to automate this process.

To use it :
- Download and install AutoIt
- Copy/Paste this script in an .au3 script
- Edit the path of your TimeStamp EXE
- Copy in a file of the name <au3_script_name>.ini the SA2 files you want to include (one by line with full path. 'Dir' can help Wink)
- Launch the script and... wait and look

Comments are in French Razz

What it does :
- Search the .ini file and if it exist, open TimeStamp
- Create a new file (for those like me that open the last project)
- For each line, if the file exist :
- Append a file
- Paste the name of the line

Enjoy...

Code:

$ts_exe = "C:\Program Files\Time Stamp\Timestamp.exe"

$INIFile = StringLeft(@ScriptName, StringLen(@ScriptName) - 3) & "ini"
;MsgBox ( 1, "Debug", $INIFile)

; => Si fichier des fichier existe alors...
If FileExists($INIFile) then

  ; => Lance TS
  Run($ts_exe)
 
  ; => Attend
  winwaitactive("Time Stamp")
 
  ; => Nouveau Fichier
  Send("^n")

  AppendFiles($INIFile)

EndIf


Func AppendFiles($filename)

  $file = FileOpen($filename, 0)
 
  ; Check if file opened for reading OK
  If $file = -1 Then
    MsgBox(0, "Error", "Unable to open file.")
    Exit
  EndIf
 
  ; Sauvegarde le presse-papier
  $clipboard = ClipGet()

; Read in lines of text until the EOF is reached
  While 1
    $line = FileReadLine($file)
    If @error = -1 Then ExitLoop

    ; => Si fichier existe
    If FileExists($line) Then
      ; => Append
      Send("^a")
     
      ; Attente
      winwaitactive("Open")
     
      ; Copie le fichier dans le presse-papier
      $clipboard_tmp = ClipPut($line)

      ; Envoi Fichier
      send("^v{ENTER}")
    EndIf
  Wend
 
  FileClose($file)

  ; Restore le presse-papier
  ClipPut($clipboard)


EndFunc
Back to top
View user's profile Send private message
syntap
Site Admin


Joined: 09 Sep 2003
Posts: 132

PostPosted: Wed Oct 11, 2006    Post subject: Reply with quote

Looks great! Hopefully others will find this method useful as well.

Here's the link for AutoIt if others are interested:

http://www.autoitscript.com/autoit3/
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Syntap Software Forum Forum Index -> General All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group