嗨下面的代碼是我創建CSV文件的代碼。 csv的創建是正常的,但是當csv轉換爲文本文件時,它們應該在值的開始和結尾之間引用引號。 EX:在CSV文件中,值是:Jham,在文本文件中它應該是:「Jham」 - 我如何管理它?有人可以幫忙嗎?在CSV文件中的非引用標記,但在TXT文件中它有
listofValue = ZipFileStr & "," & Img1Val & "," & Img2Val & "," & RExVal & "," & BundleNo & "," & BundleNo & "," & URNVal & "," & PromocodeVal & "," & ZipFileStore & "," & SNumVal & "," & DpackVal & "," & ArrivalDate & "," & CompleteDateTwo & "," & KidPCVal & "," & MDBName
Dim PathX As String = TempPath & "\"
If Not IO.Directory.Exists(PathX) Then
MkDir(PathX)
End If
Dim sampleX As String = PathX & ZipFileStr & "P.csv"
Dim outFile As IO.StreamWriter = My.Computer.FileSystem.OpenTextFileWriter(sampleX, True)
outFile.WriteLine(listofValue)
outFile.Close()
我對它有過研究,但我從未嘗試過。它看起來與你的建議相同。我會在稍後做。感謝這一點。一旦它是正確的,我會通知你。謝謝你 – Jham
嗨!它實際上沒有工作 – Jham
我發佈的代碼將給你一個逗號分隔的字符串,每個值用雙引號括起來。如果這就是你想要的,那麼正確使用我的代碼將工作。如果這就是你想要的,它不適合你,那麼你做錯了。不知道你做了什麼,沒有辦法知道它有什麼問題。 – jmcilhinney