53 lines
1.6 KiB
Plaintext
53 lines
1.6 KiB
Plaintext
Imports System.IO
|
|
Module Module1
|
|
|
|
Dim ds As New DataSet
|
|
Sub Main()
|
|
Dim subdir As Integer = 0
|
|
Dim outputpath As String
|
|
|
|
outputpath = My.Settings.OutputPath + subdir.ToString + "\"
|
|
System.IO.Directory.CreateDirectory(outputpath)
|
|
|
|
Dim i As Integer
|
|
FileOpen(1, My.Settings.InputFile, OpenMode.Input)
|
|
Dim s As String
|
|
Dim Filename As String
|
|
ds.ReadXml(My.Settings.Strukturfile)
|
|
ds.Tables(0).Rows.Clear()
|
|
|
|
While Not EOF(1)
|
|
Input(1, s)
|
|
i = i + 1
|
|
If i > 500 Then
|
|
i = 0
|
|
ds.WriteXml(outputpath + s + ".ind")
|
|
ds.Tables(0).Rows.Clear()
|
|
subdir = subdir + 1
|
|
outputpath = My.Settings.OutputPath + subdir.ToString + "\"
|
|
System.IO.Directory.CreateDirectory(outputpath)
|
|
End If
|
|
Dim dr As DataRow
|
|
|
|
Filename = s + "_AGB.pdf"
|
|
dr = ds.Tables(0).NewRow
|
|
For Each c As DataColumn In ds.Tables(0).Columns
|
|
dr(c.ColumnName) = ""
|
|
Next
|
|
dr("Partnernr") = s
|
|
dr("Funktion") = "ADD"
|
|
dr("Dokumenttypnr") = My.Settings.Doktype.ToString
|
|
dr("dateiname") = Filename
|
|
dr("Dateiformat") = "PDF"
|
|
dr("Ersteller") = My.Settings.Ersteller
|
|
dr("dokumentwert2") = ""
|
|
ds.Tables(0).Rows.Add(dr)
|
|
System.IO.File.Copy(My.Settings.AGBFile, outputpath + Filename)
|
|
End While
|
|
ds.WriteXml(outputpath + s + ".ind")
|
|
|
|
|
|
End Sub
|
|
|
|
End Module
|