Remove duplicate ReadCSVFile functions
This commit is contained in:
@@ -76,27 +76,6 @@ Function SelectCSVFile() As String
|
|||||||
End With
|
End With
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Function ReadCSVFile(ByVal filePath As String) As Variant
|
|
||||||
If filePath = "" Then
|
|
||||||
ReadCSVFile = Array()
|
|
||||||
Exit Function
|
|
||||||
End If
|
|
||||||
|
|
||||||
Dim stream As Object
|
|
||||||
Dim textContent As String
|
|
||||||
|
|
||||||
Set stream = CreateObject("ADODB.Stream")
|
|
||||||
With stream
|
|
||||||
.Type = 2
|
|
||||||
.Charset = "shift_jis"
|
|
||||||
.Open
|
|
||||||
.LoadFromFile filePath
|
|
||||||
textContent = .ReadText
|
|
||||||
.Close
|
|
||||||
End With
|
|
||||||
|
|
||||||
ReadCSVFile = Split(textContent, vbLf)
|
|
||||||
End Function
|
|
||||||
|
|
||||||
Function GetSaveCSVPath(Optional ByVal defaultName As String = "") As String
|
Function GetSaveCSVPath(Optional ByVal defaultName As String = "") As String
|
||||||
Dim savePath As String
|
Dim savePath As String
|
||||||
@@ -130,27 +109,6 @@ Sub WriteCSVFile(ByVal filePath As String, ByVal content As String)
|
|||||||
End With
|
End With
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Function ReadCSVFileWithUtf8(ByVal filePath As String) As Variant
|
|
||||||
If filePath = "" Then
|
|
||||||
ReadCSVFileWithUtf8 = Array()
|
|
||||||
Exit Function
|
|
||||||
End If
|
|
||||||
|
|
||||||
Dim stream As Object
|
|
||||||
Dim textContent As String
|
|
||||||
|
|
||||||
Set stream = CreateObject("ADODB.Stream")
|
|
||||||
With stream
|
|
||||||
.Type = 2
|
|
||||||
.Charset = "utf-8"
|
|
||||||
.Open
|
|
||||||
.LoadFromFile filePath
|
|
||||||
textContent = .ReadText
|
|
||||||
.Close
|
|
||||||
End With
|
|
||||||
|
|
||||||
ReadCSVFileWithUtf8 = Split(textContent, vbLf)
|
|
||||||
End Function
|
|
||||||
|
|
||||||
Function ReadCSVFile(ByVal filePath As String, Optional ByVal charset As String = "shift_jis") As Variant
|
Function ReadCSVFile(ByVal filePath As String, Optional ByVal charset As String = "shift_jis") As Variant
|
||||||
If filePath = "" Then
|
If filePath = "" Then
|
||||||
|
|||||||
Reference in New Issue
Block a user