处理CSV文件,一行行读取并存为数组(Domino + C#)
2011-02-19 15:17
375 查看
一、Domino中的函数
Private Const CLASS_NAME = "HandleCSVFile"
Private objLog As StdLog
Public Class HandleCSVFile
Private db As NotesDatabase
Private sess As NotesSession
Private ws As NotesUIWorkspace
''Private strFullPath As String
Sub new()
On Error Goto ErrHandler
Const PROC_NAME = "New"
WriteLog PROC_NAME, PROC_START, DEBUG_LOG
Set sess = New NotesSession
Set db = sess.CurrentDatabase
Set ws = New NotesUIWorkspace
ExitPoint:
WriteLog PROC_NAME, PROC_END, DEBUG_LOG
Exit Sub
ErrHandler:
WriteLog PROC_NAME, "Line " & Cstr(Erl) & " - " & Error$ & " (" & Cstr(Err) & ")" , ERROR_LOG
Resume ExitPoint
End Sub
Public Function ImportCSVToMappingProfile(strFilePath As String)
On Error Goto ErrHandler
Const PROC_NAME = "ImportCSVToMappingProfile"
WriteLog PROC_NAME, PROC_START, DEBUG_LOG
Dim fileNum As Integer
Dim strLineData As String
Dim vntLineData As Variant
Dim counter As Integer
Dim docMappingProfile As NotesDocument
Dim dcMapping As NotesDocumentCollection
Dim docMapping As NotesDocument
Dim strFormula As String
Dim strMachineID As String
Dim strOctopusID As String
fileNum = Freefile()
counter = 0
Open strFilePath For Input As fileNum%
Do While Not Eof(fileNum%)
Line Input #fileNum%, strLineData$
vntLineData = SplitCSVValue(strLineData$) ''Machine ID + Octopus ID
counter = counter + 1
''rule out the first line
If counter > 1 Then
If vntLineData(0) <> "" And vntLineData(1) <> "" Then
strMachineID = vntLineData(0)
strOctopusID = vntLineData(1)
strFormula = {(Form="MappingProfile") & (MachineID="} + strMachineID + {")}
Set dcMapping = db.Search(strFormula,Nothing,0)
If dcMapping.Count > 0 Then
Call dcMapping.StampAll("OctopusID",strOctopusID)
WriteLog PROC_NAME, "Mapping Profile: Update Octopus ID to '" + strOctopusID + "' depending on Machine ID '"+strMachineID+"'" , INFORMATION_LOG
Else
Set docMappingProfile = New NotesDocument(db)
With docMappingProfile
.Form = "MappingProfile"
.FormType = "MappingProfile"
.MachineID = strMachineID
.OctopusID = strOctopusID
End With
Call docMappingProfile.Save(True,False)
WriteLog PROC_NAME, "Create a new Mapping Profile, Machine ID is '" + strMachineID + "', Octopus ID is '"+strOctopusID+"'" , INFORMATION_LOG
End If
End If
End If
Loop
Msgbox "Import successfully.",48,"Ricoh"
ExitPoint:
WriteLog PROC_NAME, PROC_END, DEBUG_LOG
Exit Function
ErrHandler:
WriteLog PROC_NAME, "Line " & Cstr(Erl) & " - " & Error$ & " (" & Cstr(Err) & ")" , ERROR_LOG
Resume ExitPoint
End Function
Public Function ExportMappingProfileToCSV()
On Error Goto ErrHandler
Const PROC_NAME = "ExportMappingProfileToCSV"
WriteLog PROC_NAME, PROC_START, DEBUG_LOG
Dim fileName As Variant
Dim fileNum As Integer
Dim strMachineID As String
Dim strOctopusID As String
Dim dcMapping As NotesDocumentCollection
Dim docMapping As NotesDocument
Dim strFormula As String
Dim i As Integer
fileName = ws.SaveFileDialog(False,"Save Directory","CSV|*.csv","c:\","MappingProfile.csv")
If Not(Isempty(fileName)) Then
fileNum% = Freefile()
strFormula = {(Form="MappingProfile")}
Set dcMapping = db.Search(strFormula,Nothing,0)
If dcMapping.Count > 0 Then
Open fileName(0) For Output As fileNum%
Print #fileNum%, "Machine ID" + "," + "Octopus ID"
For i = 1 To dcMapping.Count
Set docMapping = dcMapping.GetNthDocument(i)
strMachineID = docMapping.GetItemValue("MachineID")(0)
strOctopusID = docMapping.GetItemValue("OctopusID")(0)
If Instr(strMachineID,"""") > 0 Then
strMachineID = Replace(strMachineID,"""","""""")
End If
If Instr(strOctopusID,"""") > 0 Then
strOctopusID = Replace(strOctopusID,"""","""""")
End If
If Instr(strMachineID,",") > 0 Then
strMachineID = {"} + strMachineID + {"}
End If
If Instr(strOctopusID,",") > 0 Then
strOctopusID = {"} + strOctopusID + {"}
End If
Print #fileNum%, strMachineID + "," + strOctopusID
Next
Close fileNum%
WriteLog PROC_NAME, "Export all mapping profile to file '" + Cstr(fileName(0)) + "'", INFORMATION_LOG
End If
Msgbox "Export successfully.",48,"Ricoh"
End If
ExitPoint:
WriteLog PROC_NAME, PROC_END, DEBUG_LOG
Exit Function
ErrHandler:
WriteLog PROC_NAME, "Line " & Cstr(Erl) & " - " & Error$ & " (" & Cstr(Err) & ")" , ERROR_LOG
Resume ExitPoint
End Function
Private Function SplitCSVValue(Byval LineStrData As String) As Variant
On Error Goto ErrHandler
Const PROC_NAME = "SplitCSVValue"
WriteLog PROC_NAME, PROC_START, DEBUG_LOG
Dim vntReturn As Variant
If Instr(LineStrData, ",") > 0 Then
vntReturn = SplitValue(LineStrData)
Else
Redim vntReturn(0)
vntReturn(0) = LineStrData
End If
SplitCSVValue = vntReturn
ExitPoint:
WriteLog PROC_NAME, PROC_END, DEBUG_LOG
Exit Function
ErrHandler:
WriteLog PROC_NAME, "Line " & Cstr(Erl) & " - " & Error$ & " (" & Cstr(Err) & ")" , ERROR_LOG
Resume ExitPoint
End Function
Private Function SplitValue(Byval OrgValue As String) As Variant
On Error Goto ErrHandler
Const PROC_NAME = "SplitValue"
WriteLog PROC_NAME, PROC_START, DEBUG_LOG
Dim vntTmp As Variant
Dim strTmp As String
Dim strNotSplit As String
Dim intLastCommaPos As Integer
Dim intPreCommaPos As Integer
Dim intTmpPos As Integer
Redim vntTmp(0)
strNotSplit = OrgValue
intPreCommaPos = 1
While strNotSplit <> ""
intLastCommaPos = Instr(intPreCommaPos, strNotSplit, ",")
If intLastCommaPos = 0 Then
If IsEvenQuotation(strNotSplit) Then
vntTmp(Ubound(vntTmp)) = FormatStr(strNotSplit)
Else
vntTmp(Ubound(vntTmp)) = strNotSplit
End If
End If
If intLastCommaPos > 0 Then
strTmp = Mid(strNotSplit, 1, intLastCommaPos - 1)
If IsEvenQuotation(strTmp) Then
vntTmp(Ubound(vntTmp)) = FormatStr(strTmp)
Redim Preserve vntTmp(Ubound(vntTmp) + 1)
intPreCommaPos = 1
strNotSplit = Mid(strNotSplit, intLastCommaPos + 1)
Else
intPreCommaPos = intLastCommaPos + 1
End If
Else
strNotSplit = ""
End If
Wend
SplitValue = vntTmp
ExitPoint:
WriteLog PROC_NAME, PROC_END, DEBUG_LOG
Exit Function
ErrHandler:
WriteLog PROC_NAME, "Line " & Cstr(Erl) & " - " & Error$ & " (" & Cstr(Err) & ")" , ERROR_LOG
Resume ExitPoint
End Function
Private Function IsEvenQuotation(Byval strTmp As String) As Boolean
On Error Goto ErrHandler
Const PROC_NAME = "IsEvenQuotation"
WriteLog PROC_NAME, PROC_START, DEBUG_LOG
Dim intQuotationCount As Integer
Dim intStart As Integer
intQuotationCount = 0
intStart = 0
IsEvenQuotation = True
While Instr(intStart + 1, strTmp, """") > 0
intStart = Instr(intStart + 1, strTmp, """")
intQuotationCount = intQuotationCount + 1
Wend
If intQuotationCount Mod 2 <> 0 Then
IsEvenQuotation = False
End If
ExitPoint:
WriteLog PROC_NAME, PROC_END, DEBUG_LOG
Exit Function
ErrHandler:
WriteLog PROC_NAME, "Line " & Cstr(Erl) & " - " & Error$ & " (" & Cstr(Err) & ")" , ERROR_LOG
Resume ExitPoint
End Function
Private Function FormatStr(Byval strTmp As String) As String
On Error Goto ErrHandler
Const PROC_NAME = "FormatStr"
WriteLog PROC_NAME, PROC_START, DEBUG_LOG
Dim strReturn As String
strReturn = strTmp
If Left(strReturn, 1) = """" Then
strReturn = Mid(strReturn, 2)
strReturn = Mid(strReturn, 1, Len(strReturn) - 1)
End If
FormatStr = Replace(strReturn, String(2, """"), """")
ExitPoint:
WriteLog PROC_NAME, PROC_END, DEBUG_LOG
Exit Function
ErrHandler:
WriteLog PROC_NAME, "Line " & Cstr(Erl) & " - " & Error$ & " (" & Cstr(Err) & ")" , ERROR_LOG
Resume ExitPoint
End Function
Private Function WriteLog(Byval Source As String, Byval LogMessage As String, LogLevel As Integer) As Integer
On Error Goto ErrHandler
Const PROC_NAME = "WriteLog"
WriteLog = False
If objLog Is Nothing Then
Set objLog = CreateLogObject()
End If
objLog.WriteLog CLASS_NAME & "\" & Source, LogMessage, LogLevel
WriteLog = True
Exit Function
ErrHandler:
Msgbox CLASS_NAME & "\" & Source & ": " & LogMessage, 48, CLASS_NAME
Exit Function
End Function
End Class
二、C#处理函数
using System;
using System.Collections.Generic;
using System.Text;
using System.Collections;
namespace Common
{
public class HandlecCSVFile
{
public HandlecCSVFile()
{
}
public string[] SplitCSVLine(string lineData)
{
ArrayList columnsValue;
if (lineData.IndexOf(',') != -1)
{
columnsValue = SplitLine(lineData);
}
else
{
columnsValue = new ArrayList();
columnsValue.Add(lineData);
}
return (string[])columnsValue.ToArray(typeof(string));
}
private ArrayList SplitLine(string originalValue)
{
ArrayList columnsValue;
string notSplit;
int preCommaPos;
int lastCommaPos;
char splitBy;
string temp;
notSplit = originalValue;
columnsValue = new ArrayList();
splitBy = ',';
columnsValue.Add("");
preCommaPos = 0;
while (notSplit != string.Empty)
{
lastCommaPos = notSplit.IndexOf(splitBy, preCommaPos);
if (lastCommaPos == -1)
{
if (IsEvenQuotation(notSplit))
{
columnsValue[columnsValue.Count-1] = FormatStr(notSplit);
}
else
{
columnsValue[columnsValue.Count-1] = notSplit;
}
}
if (lastCommaPos > -1)
{
temp = notSplit.Substring(0, lastCommaPos);
if (IsEvenQuotation(temp))
{
columnsValue[columnsValue.Count - 1] = FormatStr(temp);
columnsValue.Add("");
preCommaPos = 0;
notSplit = notSplit.Substring(lastCommaPos + 1);
}
else
{
preCommaPos = lastCommaPos + 1;
}
}
else
{
notSplit = string.Empty;
}
}
return columnsValue;
}
private bool IsEvenQuotation(string tempString)
{
int quotationCount;
int start;
quotationCount = 0;
start = -1;
while (tempString.IndexOf('"', start+1) != -1)
{
start = tempString.IndexOf('"', start + 1);
quotationCount = quotationCount + 1;
}
if (quotationCount % 2 != 0)
{
return false;
}
else
{
return true;
}
}
private string FormatStr(string tempString)
{
string rtnString = tempString;
if (tempString.StartsWith("\"") == true)
{
rtnString = rtnString.Substring(1);
rtnString = rtnString.Substring(0, rtnString.Length - 1);
}
return rtnString.Replace("\"\"", "\"");
}
}
}
Private Const CLASS_NAME = "HandleCSVFile"
Private objLog As StdLog
Public Class HandleCSVFile
Private db As NotesDatabase
Private sess As NotesSession
Private ws As NotesUIWorkspace
''Private strFullPath As String
Sub new()
On Error Goto ErrHandler
Const PROC_NAME = "New"
WriteLog PROC_NAME, PROC_START, DEBUG_LOG
Set sess = New NotesSession
Set db = sess.CurrentDatabase
Set ws = New NotesUIWorkspace
ExitPoint:
WriteLog PROC_NAME, PROC_END, DEBUG_LOG
Exit Sub
ErrHandler:
WriteLog PROC_NAME, "Line " & Cstr(Erl) & " - " & Error$ & " (" & Cstr(Err) & ")" , ERROR_LOG
Resume ExitPoint
End Sub
Public Function ImportCSVToMappingProfile(strFilePath As String)
On Error Goto ErrHandler
Const PROC_NAME = "ImportCSVToMappingProfile"
WriteLog PROC_NAME, PROC_START, DEBUG_LOG
Dim fileNum As Integer
Dim strLineData As String
Dim vntLineData As Variant
Dim counter As Integer
Dim docMappingProfile As NotesDocument
Dim dcMapping As NotesDocumentCollection
Dim docMapping As NotesDocument
Dim strFormula As String
Dim strMachineID As String
Dim strOctopusID As String
fileNum = Freefile()
counter = 0
Open strFilePath For Input As fileNum%
Do While Not Eof(fileNum%)
Line Input #fileNum%, strLineData$
vntLineData = SplitCSVValue(strLineData$) ''Machine ID + Octopus ID
counter = counter + 1
''rule out the first line
If counter > 1 Then
If vntLineData(0) <> "" And vntLineData(1) <> "" Then
strMachineID = vntLineData(0)
strOctopusID = vntLineData(1)
strFormula = {(Form="MappingProfile") & (MachineID="} + strMachineID + {")}
Set dcMapping = db.Search(strFormula,Nothing,0)
If dcMapping.Count > 0 Then
Call dcMapping.StampAll("OctopusID",strOctopusID)
WriteLog PROC_NAME, "Mapping Profile: Update Octopus ID to '" + strOctopusID + "' depending on Machine ID '"+strMachineID+"'" , INFORMATION_LOG
Else
Set docMappingProfile = New NotesDocument(db)
With docMappingProfile
.Form = "MappingProfile"
.FormType = "MappingProfile"
.MachineID = strMachineID
.OctopusID = strOctopusID
End With
Call docMappingProfile.Save(True,False)
WriteLog PROC_NAME, "Create a new Mapping Profile, Machine ID is '" + strMachineID + "', Octopus ID is '"+strOctopusID+"'" , INFORMATION_LOG
End If
End If
End If
Loop
Msgbox "Import successfully.",48,"Ricoh"
ExitPoint:
WriteLog PROC_NAME, PROC_END, DEBUG_LOG
Exit Function
ErrHandler:
WriteLog PROC_NAME, "Line " & Cstr(Erl) & " - " & Error$ & " (" & Cstr(Err) & ")" , ERROR_LOG
Resume ExitPoint
End Function
Public Function ExportMappingProfileToCSV()
On Error Goto ErrHandler
Const PROC_NAME = "ExportMappingProfileToCSV"
WriteLog PROC_NAME, PROC_START, DEBUG_LOG
Dim fileName As Variant
Dim fileNum As Integer
Dim strMachineID As String
Dim strOctopusID As String
Dim dcMapping As NotesDocumentCollection
Dim docMapping As NotesDocument
Dim strFormula As String
Dim i As Integer
fileName = ws.SaveFileDialog(False,"Save Directory","CSV|*.csv","c:\","MappingProfile.csv")
If Not(Isempty(fileName)) Then
fileNum% = Freefile()
strFormula = {(Form="MappingProfile")}
Set dcMapping = db.Search(strFormula,Nothing,0)
If dcMapping.Count > 0 Then
Open fileName(0) For Output As fileNum%
Print #fileNum%, "Machine ID" + "," + "Octopus ID"
For i = 1 To dcMapping.Count
Set docMapping = dcMapping.GetNthDocument(i)
strMachineID = docMapping.GetItemValue("MachineID")(0)
strOctopusID = docMapping.GetItemValue("OctopusID")(0)
If Instr(strMachineID,"""") > 0 Then
strMachineID = Replace(strMachineID,"""","""""")
End If
If Instr(strOctopusID,"""") > 0 Then
strOctopusID = Replace(strOctopusID,"""","""""")
End If
If Instr(strMachineID,",") > 0 Then
strMachineID = {"} + strMachineID + {"}
End If
If Instr(strOctopusID,",") > 0 Then
strOctopusID = {"} + strOctopusID + {"}
End If
Print #fileNum%, strMachineID + "," + strOctopusID
Next
Close fileNum%
WriteLog PROC_NAME, "Export all mapping profile to file '" + Cstr(fileName(0)) + "'", INFORMATION_LOG
End If
Msgbox "Export successfully.",48,"Ricoh"
End If
ExitPoint:
WriteLog PROC_NAME, PROC_END, DEBUG_LOG
Exit Function
ErrHandler:
WriteLog PROC_NAME, "Line " & Cstr(Erl) & " - " & Error$ & " (" & Cstr(Err) & ")" , ERROR_LOG
Resume ExitPoint
End Function
Private Function SplitCSVValue(Byval LineStrData As String) As Variant
On Error Goto ErrHandler
Const PROC_NAME = "SplitCSVValue"
WriteLog PROC_NAME, PROC_START, DEBUG_LOG
Dim vntReturn As Variant
If Instr(LineStrData, ",") > 0 Then
vntReturn = SplitValue(LineStrData)
Else
Redim vntReturn(0)
vntReturn(0) = LineStrData
End If
SplitCSVValue = vntReturn
ExitPoint:
WriteLog PROC_NAME, PROC_END, DEBUG_LOG
Exit Function
ErrHandler:
WriteLog PROC_NAME, "Line " & Cstr(Erl) & " - " & Error$ & " (" & Cstr(Err) & ")" , ERROR_LOG
Resume ExitPoint
End Function
Private Function SplitValue(Byval OrgValue As String) As Variant
On Error Goto ErrHandler
Const PROC_NAME = "SplitValue"
WriteLog PROC_NAME, PROC_START, DEBUG_LOG
Dim vntTmp As Variant
Dim strTmp As String
Dim strNotSplit As String
Dim intLastCommaPos As Integer
Dim intPreCommaPos As Integer
Dim intTmpPos As Integer
Redim vntTmp(0)
strNotSplit = OrgValue
intPreCommaPos = 1
While strNotSplit <> ""
intLastCommaPos = Instr(intPreCommaPos, strNotSplit, ",")
If intLastCommaPos = 0 Then
If IsEvenQuotation(strNotSplit) Then
vntTmp(Ubound(vntTmp)) = FormatStr(strNotSplit)
Else
vntTmp(Ubound(vntTmp)) = strNotSplit
End If
End If
If intLastCommaPos > 0 Then
strTmp = Mid(strNotSplit, 1, intLastCommaPos - 1)
If IsEvenQuotation(strTmp) Then
vntTmp(Ubound(vntTmp)) = FormatStr(strTmp)
Redim Preserve vntTmp(Ubound(vntTmp) + 1)
intPreCommaPos = 1
strNotSplit = Mid(strNotSplit, intLastCommaPos + 1)
Else
intPreCommaPos = intLastCommaPos + 1
End If
Else
strNotSplit = ""
End If
Wend
SplitValue = vntTmp
ExitPoint:
WriteLog PROC_NAME, PROC_END, DEBUG_LOG
Exit Function
ErrHandler:
WriteLog PROC_NAME, "Line " & Cstr(Erl) & " - " & Error$ & " (" & Cstr(Err) & ")" , ERROR_LOG
Resume ExitPoint
End Function
Private Function IsEvenQuotation(Byval strTmp As String) As Boolean
On Error Goto ErrHandler
Const PROC_NAME = "IsEvenQuotation"
WriteLog PROC_NAME, PROC_START, DEBUG_LOG
Dim intQuotationCount As Integer
Dim intStart As Integer
intQuotationCount = 0
intStart = 0
IsEvenQuotation = True
While Instr(intStart + 1, strTmp, """") > 0
intStart = Instr(intStart + 1, strTmp, """")
intQuotationCount = intQuotationCount + 1
Wend
If intQuotationCount Mod 2 <> 0 Then
IsEvenQuotation = False
End If
ExitPoint:
WriteLog PROC_NAME, PROC_END, DEBUG_LOG
Exit Function
ErrHandler:
WriteLog PROC_NAME, "Line " & Cstr(Erl) & " - " & Error$ & " (" & Cstr(Err) & ")" , ERROR_LOG
Resume ExitPoint
End Function
Private Function FormatStr(Byval strTmp As String) As String
On Error Goto ErrHandler
Const PROC_NAME = "FormatStr"
WriteLog PROC_NAME, PROC_START, DEBUG_LOG
Dim strReturn As String
strReturn = strTmp
If Left(strReturn, 1) = """" Then
strReturn = Mid(strReturn, 2)
strReturn = Mid(strReturn, 1, Len(strReturn) - 1)
End If
FormatStr = Replace(strReturn, String(2, """"), """")
ExitPoint:
WriteLog PROC_NAME, PROC_END, DEBUG_LOG
Exit Function
ErrHandler:
WriteLog PROC_NAME, "Line " & Cstr(Erl) & " - " & Error$ & " (" & Cstr(Err) & ")" , ERROR_LOG
Resume ExitPoint
End Function
Private Function WriteLog(Byval Source As String, Byval LogMessage As String, LogLevel As Integer) As Integer
On Error Goto ErrHandler
Const PROC_NAME = "WriteLog"
WriteLog = False
If objLog Is Nothing Then
Set objLog = CreateLogObject()
End If
objLog.WriteLog CLASS_NAME & "\" & Source, LogMessage, LogLevel
WriteLog = True
Exit Function
ErrHandler:
Msgbox CLASS_NAME & "\" & Source & ": " & LogMessage, 48, CLASS_NAME
Exit Function
End Function
End Class
二、C#处理函数
using System;
using System.Collections.Generic;
using System.Text;
using System.Collections;
namespace Common
{
public class HandlecCSVFile
{
public HandlecCSVFile()
{
}
public string[] SplitCSVLine(string lineData)
{
ArrayList columnsValue;
if (lineData.IndexOf(',') != -1)
{
columnsValue = SplitLine(lineData);
}
else
{
columnsValue = new ArrayList();
columnsValue.Add(lineData);
}
return (string[])columnsValue.ToArray(typeof(string));
}
private ArrayList SplitLine(string originalValue)
{
ArrayList columnsValue;
string notSplit;
int preCommaPos;
int lastCommaPos;
char splitBy;
string temp;
notSplit = originalValue;
columnsValue = new ArrayList();
splitBy = ',';
columnsValue.Add("");
preCommaPos = 0;
while (notSplit != string.Empty)
{
lastCommaPos = notSplit.IndexOf(splitBy, preCommaPos);
if (lastCommaPos == -1)
{
if (IsEvenQuotation(notSplit))
{
columnsValue[columnsValue.Count-1] = FormatStr(notSplit);
}
else
{
columnsValue[columnsValue.Count-1] = notSplit;
}
}
if (lastCommaPos > -1)
{
temp = notSplit.Substring(0, lastCommaPos);
if (IsEvenQuotation(temp))
{
columnsValue[columnsValue.Count - 1] = FormatStr(temp);
columnsValue.Add("");
preCommaPos = 0;
notSplit = notSplit.Substring(lastCommaPos + 1);
}
else
{
preCommaPos = lastCommaPos + 1;
}
}
else
{
notSplit = string.Empty;
}
}
return columnsValue;
}
private bool IsEvenQuotation(string tempString)
{
int quotationCount;
int start;
quotationCount = 0;
start = -1;
while (tempString.IndexOf('"', start+1) != -1)
{
start = tempString.IndexOf('"', start + 1);
quotationCount = quotationCount + 1;
}
if (quotationCount % 2 != 0)
{
return false;
}
else
{
return true;
}
}
private string FormatStr(string tempString)
{
string rtnString = tempString;
if (tempString.StartsWith("\"") == true)
{
rtnString = rtnString.Substring(1);
rtnString = rtnString.Substring(0, rtnString.Length - 1);
}
return rtnString.Replace("\"\"", "\"");
}
}
}
相关文章推荐
- [Unity][JSON][csv][JSONUnity]csv-JSON如何在CSV文件中保存数组并读取JSON数组
- 导入csv文件时,如果最后一列没有数据,读取出来的集合比抬头字段少,和数据中包含","如何处理?
- CSV文件读取和处理
- 如何高效读取CSV文件后进行高效处理?(之一:高效读取CSV格式文件)
- c语言实现把文件中数据读取并存到数组中
- c语言把文件中数据读取并存到数组中
- python 读取.csv文件数据到数组(矩阵)
- java读取目录下所有csv文件数据,存入三维数组并返回
- node.js 读取csv文件数据处理导入mongodb 数据库
- discuz,table类文件函数返回数组,在控制器中读取并处理
- pandas读取csv文件进行处理时报错: TypeError: invalid type comparison
- 读取csv文件并使用pandas.Series.apply进行处理时,对header=?的处理
- python 读取.csv文件数据到数组(矩阵)的实例讲解
- PHP把数组写进csv,和从csv文件以数组的形式读取数据
- Python将数组(矩阵)存成csv文件,将csv文件读取为数组(矩阵)
- ean13码的生成,python读取csv中数据并处理返回并写入到另一个csv文件中
- PHP按行读取、处理较大CSV文件的代码实例
- 读取大csv文件数据插入到MySql或者Oracle数据库通用处理
- 读取文件内容到int数组的函数处理方法
- MATLAB 定义结构体数组 并存到mat 文件 读取mat