Author Topic: Output as textfile  (Read 3608 times)

sinus

  • Global Moderator
  • *****
  • Posts: 4342
  • IMatch-User since 2001 (IMatch 3.6)
Output as textfile
« on: November 25, 2014, 02:11:53 PM »
I have over the last monthes "randomly" troubles with lost collections, in the weekend I lost again 814 red pins.
But if you looses collections, like pins or dots and others, it is not immediately visible, because I do not always look at collections.
To give Mario better information, I want to store my collections at least at the beginning from an IMatch-session and at the end, maybe even more often.

For this there is a nice script from Mario. The important part for me is this:
Code: [Select]
Option Explicit
Sub Main
Debug.Clear

Dim col As Collection
  For Each col In Database.Collections
Debug.Print col.Files.Count() &" files for " & col.Name
DoEvents
Next

'Application.TaskDialog "Completed","See the Output Panel for information.",etbOK,etiInformation
End Sub

This gives a good output like this here:

0 files for Collections
127 files for Bookmarks
148599 files for Pending Metadata Write-back
0 files for Flags
9 files for Set
1 files for Unset
170867 files for None
0 files for Dots
2 files for Red
10 files for Green
10 files for Blue
170855 files for None
0 files for Pins
843 files for Red
843 files for Green
...


Now I have two questions, what are sounds simple, but I could not get it until now.
I want  these output have somewhere saved as a simple textfile (txt).
Because then I could open the old txt, create the new and compare then these two files.

Do you know, how I could do this? I know, there are commands like open, close and so on, but I am simply not able to do it properly.


The second question is not that important.
Because in my case the lost collections are always pins, dots and flags, but not bookmarks or collections, what shows yesterday or last month, how could I script the lines, what would me show only the dots, pins and flags, so I would end with something like

xxx files with green dots
xxx files with red dots
xxx files with blue dots

xxx files with green pins
xxx files with red pins
xxx files with blue pins

xxx files with flags
xxx files with set flags
xxx files with unset flags

Thanks for any help, I hope, that this helps me (and Mario) to track down these "bewitched loosing collections".

Best wishes from Switzerland! :-)
Markus

Mario

  • IMatch Developer
  • Administrator
  • *****
  • Posts: 28532
Re: Output as textfile
« Reply #1 on: November 25, 2014, 02:33:58 PM »
What did you do to lose collections? No other users have reported problems since build .14 and I'm a bit baffled by this. Did you open a bug report?

sinus

  • Global Moderator
  • *****
  • Posts: 4342
  • IMatch-User since 2001 (IMatch 3.6)
Re: Output as textfile
« Reply #2 on: November 25, 2014, 02:43:03 PM »
What did you do to lose collections? No other users have reported problems since build .14 and I'm a bit baffled by this. Did you open a bug report?

No, sorry, Mario, the problem is, that I have no logs from this happening. And to be honest, I ca not really tell you, what I have done. But I have lost also with .14 also dots, but only a few, and I thought and hoped, that this was a single accident and did not report it.  :-[ :-[ :-[ (shame on me)

But over the weekend I lost really a lot of red pins, but I realized it too late, so I cannot say, what I did.  :-\ :-[

But I am quite sure, that it will again happens for me, that is why I have this plan with such a script. Because I would try to be disciplined, so that I let run the script at start of IM, and at the end.
Then I could comparing and if collections are lost, then I would knew it and could save and send the log for you.

Do you not think, this would be a try with such a script for me?
Best wishes from Switzerland! :-)
Markus

Mario

  • IMatch Developer
  • Administrator
  • *****
  • Posts: 28532
Re: Output as textfile
« Reply #3 on: November 25, 2014, 04:53:34 PM »
I'm not sure that any kind of log you create would be of any help.

It is way more important to know how you changed the collection (from the file window, where, how, in which sequence, which collection).
I cannot find any problem in how files are added or removed from collections. Are you sure this is not a side effect of a metadata template you run, or maybe some file relation propagation rules you have defined, or options you have configured for importing files? All these things can add and remove files from collections without you actively doing anything...

sinus

  • Global Moderator
  • *****
  • Posts: 4342
  • IMatch-User since 2001 (IMatch 3.6)
Re: Output as textfile
« Reply #4 on: November 25, 2014, 05:07:04 PM »
OK, Mario,

so I will try to look again more carefully, first, when collections does vanish and if, what I have done.

I am quite sure, that there is no other action (Metadata, relations rule and so on) affected. But I will look again into this. As soon as it happens again, I will report it, hopefully with more and better information from me.

Thanks!
Best wishes from Switzerland! :-)
Markus

sinus

  • Global Moderator
  • *****
  • Posts: 4342
  • IMatch-User since 2001 (IMatch 3.6)
Re: Output as textfile
« Reply #5 on: November 26, 2014, 04:38:04 PM »
BTW: I could manage to let flow the informations into Word, you can see this in the attachement. The line for specific collections are like this:

Code: [Select]
Set col = Database.Collections.Get(ctypeDotRed)
    rotdot = col.Files.Count
'    Debug.Print rotdot & " rote dots"

Set col = Database.Collections.Get(ctypeDotBlue)
    blaudot = col.Files.Count
'    Debug.Print blaudot & " blaue dots"

Here for example for red and blue dots.
Have fun.

[attachment deleted by admin]
Best wishes from Switzerland! :-)
Markus

ubacher

  • Oldtimer
  • ****
  • Posts: 2277
Re: Output as textfile
« Reply #6 on: November 26, 2014, 11:36:40 PM »
Mario always asks " what did you do?" and I always have a hard time remembering. For some time I used
screen video recording to capture all I did - and this I like to recommend to sinus.
( I must confess I did not find a (free and easy) program which records multiple monitors. For a single screen
I use the microsoft offering "Screen Recorder".)

Of course this leaves the problem to remember to turn on/off the recorder ...........

sinus

  • Global Moderator
  • *****
  • Posts: 4342
  • IMatch-User since 2001 (IMatch 3.6)
Re: Output as textfile
« Reply #7 on: November 27, 2014, 08:03:22 AM »
Mario always asks " what did you do?" and I always have a hard time remembering. For some time I used
screen video recording to capture all I did - and this I like to recommend to sinus.
( I must confess I did not find a (free and easy) program which records multiple monitors. For a single screen
I use the microsoft offering "Screen Recorder".)

Of course this leaves the problem to remember to turn on/off the recorder ...........

Thanks, ubacher
Screen video recording would be also a chance, yes.
But at the moment I will try it with this solution, what I "created". It is an easy thing and I can really very quickly see, if there was a change in the collections, because the numbers are ordered line after line:

201  99  541
201  99  412

The only thing, that I must think to let run the script (takes 5 seconds or so). But it gives me a good feeling of security :)
Best wishes from Switzerland! :-)
Markus