R5 Agent to Import Text File to Notes Documents

Author: Tripp W Black

Created: 02/09/2000 at 02:03 PM

 

Category:
Notes Developer Tips
Agents, General

Here is lotusscript code I used in an agent on R5. I read a text file containing 100,000+ records and created a document for each record. Only problem I encountered was using an Integer instead of a Double (doh!) for a counter.


Sub Initialize
Dim s As New NotesSession
Dim db As NotesDatabase
Set db = s.getDatabase([server], [database])
Dim doc As NotesDocument

fileno% = Freefile()
filename$ = "c:\tmp\file.txt"

Open filename$ For Input As fileno%
Line Input #fileno%, txt$

Do Until Eof(fileno%)
Line Input #fileno%, txt$
:
:
:

Set doc = db.createdocument
:
:
:
Call doc.save(True, False)
Loop

Close fileno%
End Sub

previous page