Domino 9 und frühere Versionen > ND7: Entwicklung
Export von Notes-Daten in eine Datei
(1/1)
sja:
Hallo @All,
Die Daten aus einer Notes-Datenbank sollen per eine s.g. SIMBA-ASCII-Schnittstelle (SCS) z.B. Dateiname “xxx.scs“ nach die Anwendung SIMBA exportiert werden.
Das Trennzeichen für Felder in dem Datensatz muss Semikolon sein und Trennziechen für Nachkommastellen muss Komma sein. (s. Anhang soll.txt)
Aber ich bekomme mit einem Agent (s. Code unten) eine Komma als das Tennzeichen für Felder (s. Anhang ist.txt)
Meine Frage: wie kann ich statt einer Komma ein Semikolon schaffen
Dim s As NotesSession
Dim db As NotesDatabase
Dim view As NotesView
Dim VEC As NotesViewEntryCollection
Dim ve As NotesViewEntry
Dim doc As NotesDocument
Dim fileName As String
Dim tmpExportSimba(0 To 17) As String
Sub Initialize
Set s = New NotesSession
Set db = s.CurrentDatabase
Set view =db.getview("ExportRechnungen")
If Not(view.EntryCount = 0) Then
Set VEC = view.AllEntries
Set ve = VEC.GetFirstEntry()
fileName = "C:\Programme\lotus\notes\data\SIMBA\ist.scs"
Open fileName For Output As #1
While Not (ve Is Nothing)
Set doc = ve.Document
Write #1, doc.ExportSimba(0), doc.ExportSimba(1), doc.ExportSimba(2),_
doc.ExportSimba(3), doc.ExportSimba(4), doc.ExportSimba(5),_
doc.ExportSimba(6), doc.ExportSimba(7), doc.ExportSimba(8),_
doc.ExportSimba(9), doc.ExportSimba(10), doc.ExportSimba(11),_
doc.ExportSimba(12), doc.ExportSimba(13), doc.ExportSimba(14),_
doc.ExportSimba(15), doc.ExportSimba(16), doc.ExportSimba(17)
Set ve = VEC.getNextEntry(ve)
Wend
Close #1
End If
End Sub
vielen Dank für jede Hilfe im Voraus.
Schoene Gruesse
Sofia
m3:
Schreib doch mit Print raus.
sja:
habe schon auch ausprobiert, in diesem Fall kommen die Felder ohne Gänsefüßchen, aber die müssen da sein.
m3:
Na dann füg Doch die "Gänsefüßchen" einfach händisch dazu, weil ein ";" bekommst Du mit Write nicht hin.
Tipp:
Anstatt von
--- Code: ---Print #1, """" & doc.ExportSimba(0) & """" & doc.ExportSimba(1) ...
--- Ende Code ---
solltest Du
--- Code: ---Print #1, {"} & doc.ExportSimba(0) & {"} & doc.ExportSimba(1) ...
--- Ende Code ---
schreiben, das ist einfacher lesbar.
sja:
Herzlichen Dank @m3!
Es funktioniert!
In meinem Fall das Code sieht so aus:
Print #1, {"} & doc.ExportSimba(0) & {";"} & doc.ExportSimba(1) & {";"}_
& doc.ExportSimba(2) & {";"} & doc.ExportSimba(3) . . .
. . .
& doc.ExportSimba(22) & {";"} & doc.ExportSimba(23) & {"}
Schoene Gruesse
Sofia
Navigation
[0] Themen-Index
Zur normalen Ansicht wechseln