I need to be able to determine total number of keystrokes (metadata characters) within a folder and it's accompanying sub-folders for billing purposes. I haven't been able to find a way to do that. Anyone have any ideas?
Question
Question
Counting keystrokes or metadata characters in LF
Replies
Hi Kay,
Our EzeScan software has the functionality to do this as part of the Audit Module when capturing documents and or emails before uploading directly into Laserfiche.
Let me know if you need any more information, we can organize a Webinar and there is also Evaluation Software available to download for testing within your environment.
Screen shot attached.
Kevin (k.blackley@ezescan.com)
I'm not exactly sure what characters you're referring to. Could you please give an example?
I need to count how many keystrokes or characters are in all meta-data fields for every document within a folder and it's sub-folders. The documents were indexed within Laserfiche. I need this to be able to bill the customer for indexing.
There's no built-in way to do this. It would not be hard to write a program that uses the SDK to find documents and look at the attached fields.
Okay, thank you. I had been all over the Laserfiche repository and couldn't find a way. I was wondering if I was simply missing it.
Kay,
This is more of an academic challenge because there are several variables that make it difficult to calculate an actual keystroke count.
First, it is not quite as easy as counting the length of the metadata values stored in the fields. Some metadata field types (i.e. List) can be successfully entered with only a single keystroke. In other words you can potentially select the list value of 'Abracadabra' by keying in only an 'A'. The same with Dates and Times; you can key in either 6 or 8 numbers for a Date, and 4 or 6 numbers for a Time (depending on the format mask and workstation settings).
In addition, if you are using only the keyboard to enter data you have to hit the TAB key twice to get to the next metadata field in a template.
All of that being said; here is a code snippet for an SDK Script activity that will do some keystroke 'calculations' for a particular document with metadata assigned. The assumptions are in the Select Case branching logic where text and numeric fields keystroke counts will be the length of the data. List fields only get 1 keystroke, dates and time more keystrokes. (Note: You can edit the script to set those values to any numbers you please).
In the end you are much better off going to some type of import tool like EzeScan (posted earlier)
Protected Overrides Sub Execute() Dim keystrokeCount As Integer = 0 Dim fieldCount As Integer = 0 Try 'Only look at documents... If Me.BoundEntryInfo.EntryType = EntryType.Document Then For Each kvp As KeyValuePair(Of String, Object) In Me.BoundEntryInfo.GetFieldValues 'Only look at fields that have a value... If kvp.Value IsNot Nothing Then Dim fi As FieldInfo = Field.GetInfo(kvp.Key, Me.RASession) fieldCount += 1 Select Case fi.FieldType 'Assume that each character in a text field was keyed... Case FieldType.String keystrokeCount += kvp.Value.ToString.Length 'Assume that each character in a number field was keyed... Case FieldType.Number keystrokeCount += kvp.Value.ToString.Length 'Assume that each character in an integer field was keyed... Case FieldType.ShortInteger keystrokeCount += kvp.Value.ToString.Length 'Assume that each character in a long integer field was keyed... Case FieldType.LongInteger keystrokeCount += kvp.Value.ToString.Length 'Make an assumption that the user keyed in 8 numbers for a date... 'Literals do not count ('/' or '-') Case FieldType.Date keystrokeCount += 8 'Make an assumption that the user keyed in 4 numbers for a time... 'Literals do not count (':') Case FieldType.Time keystrokeCount += 4 'Make an assumption that the user keyed in 12 numbers for a datetime... 'Literals do not count ('/', '-', ':') Case FieldType.DateTime keystrokeCount += 12 'List valuess can be selected by keying in just 1 value... Case FieldType.List keystrokeCount +=1 End Select End If Next End If Catch ex As Exception Me.WorkflowApi.TrackError(ex.message) End Try Me.SetTokenValue("Keystrokes", keystrokeCount) Me.SetTokenValue("FieldCount", fieldCount) End Sub
Usage in a workflow might be something like this where you do a repository search and then iterate through the resulting documents and add up the 'keystrokes'.