2012-04-04 10 views
5

Ich habe eine schema.ini-Datei für eine CSV-Datei definiert, aber ich habe mehrere CSVs, für die ich die gleiche Definition verwenden möchte, da sie eine Sequenz sind.Kann eine einzelne schema.ini-Definition mehrere Dateien abdecken

Ie

File0.csv 
File1.csv 
File2.csv 
File.etc.csv 

Mein Schema so etwas wie sein würde:

[File*.csv] 
Format=Delimited(,) 
ColNameHeader=True 
col1="Brand Code" Text 
col2=Description Text 
col3="Display Sequence" Text 
+0

Es hochgeladen werden würde erscheinen die obige * Idee funktioniert nicht, hat jemand einen besseren Vorschlag? –

Antwort

5

Soweit ich kann sagen, dass dies nicht möglich ist,

- * ** * **** In der Tat ist es posibl Du kannst es auf diese Weise machen.

[file1.csv] 
FORMAT = Delimited(#) 
ColNameHeader = True 
MaxScanRows=10 
Col1=... 
Col2=... 
ColN=... 

[File2.csv] 
FORMAT = Delimited(#) 
ColNameHeader = True 
MaxScanRows=10 
Col1=... 
Col2=... 
ColN=... 

Grüße!

0

Sie können das Schema in Ihrem Modul/Unterprogramm entsprechend dem Dateiformat definieren und schreiben, das hochgeladen werden soll. Dieses Modul/sub-Routine ausgeführt werden muss/Call-Schema zu erstellen, bevor Sie Upload laufen .. (meine Probe wird mit VB6)

Hinweis: - Filenametxt ist Dateiname, die

wollen
IntFileHandleLog = FreeFile 
Open App.Path & "schema.ini" For Output As #IntFileHandleLog 
Print #IntFileHandleLog, "[" & FileNameTxt & "]" 
Print #IntFileHandleLog, "Format=FixedLength" 
Print #IntFileHandleLog, "MaxScanRows = 0" 
Print #IntFileHandleLog, "CharacterSet = OEM" 
Print #IntFileHandleLog, "Col1=" & """" & "Name" & """" & "Text Width 20" 
Print #IntFileHandleLog, "Col2=" & """" & "PHONE_NUM" & """" & " Text Width 30" 
Print #IntFileHandleLog, "Col3=" & """" & "PHONE_TYPE" & """" & " Text Width 20" 
Print #IntFileHandleLog, "col4=" & """" & "UserName" & """" & " Text Width 20" 
Print #IntFileHandleLog, "col5=" & """" & "A_STAT" & """" & " Text Width 10" 
Print #IntFileHandleLog, "col6=" & """" & "B_STAT" & """" & " Text Width 10" 
Print #IntFileHandleLog, "col7=" & """" & "RETRY" & """" & "integer width 2" 
Print #IntFileHandleLog, "col8=" & """" & "Birth_Date" & """" & " double width 14" 
Print #IntFileHandleLog, "Col9=" & """" & "Joint_Date" & """" & " double width 14" 
Close #IntFileHandleLog 
Verwandte Themen