- 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
- 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
- 4、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
- 5、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们。
- 6、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
- 7、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
读写csv文件(Read and write CSV files)
读写csv文件(Read and write CSV files)
使用系统;
文本使用系统;
使用系统。收藏;
使用System.IO;
使用数据系统;
使用system.text.regularexpressions;
使用系统诊断;
命名空间csvlib
{
#区类说明信息
/ / /内容提要
/ / / DL
/ / / 申 b读CSV文件类,读取指定的CSV文件,可以导出DataTable /b</dt
/ / / 日
/ / / ul
/ / / / UL
/ / / 日
/ / / / DL
/ / / 作者 yangzhihong /作者
/ / / 创建日期 2006 / 01 / 16 /创建日期
/ / / 公司 公司
/ / / 版 1 版本
/ / / /摘要
#铁心端部定点
csvstreamreader公共类
{
私人ArrayList Rowal;/ /行链表,CSV文件的每一行就是一个链
字符串的文件名;/ /文件名
私人/编码编码编码;
公共csvstreamreader()
{
this.rowal =新arraylist();
this.filename =“”;
this.encoding =默认编码;
}
/ / /内容提要
/ / /
/ / / /摘要
/ / / 参数名=“文件”文件名,包括文件路径 /参数
市民CsvStreamReader(字符串的文件名)
{
this.rowal =新arraylist();
this.filename =文件名;
this.encoding =默认编码;
loadcsvfile();
}
/ / /内容提要
/ / /
/ / / /摘要
/ / / 参数名=“文件”文件名,包括文件路径 /参数
/ / / 参数名=“编码”文件编码 /参数
市民CsvStreamReader(文件名字符串,编码编码)
{
this.rowal =新arraylist();
this.filename =文件名;
this.encoding =编码;
loadcsvfile();
}
/ / /内容提要
/ / /文件名,包括文件路径
/ / / /摘要
字符串的文件名
{
设置
{
this.filename =价值;
loadcsvfile();
}
}
/ / /内容提要
/ / /文件编码
/ / / /摘要
公共编码fileEncoding
{
设置
{
this.encoding =价值;
}
}
/ / /内容提要
/ / /获取行数
/ / / /摘要
public int行数
{
得到
{
返回this.rowal.count;
}
}
/ / /内容提要
/ / /获取列数
/ / / /摘要
public int ColCount、
{
得到
{
国际MAXCOL;
MAXCOL = 0;
为(int i = 0;i 这。Rowal。计数;i++)
{
ArrayList煤=(ArrayList)这Rowal [我];
MAXCOL =(MAXCOL 煤。计数)?MAXCOL:colal.count;
}
返回MAXCOL;
}
}
/ / /内容提要
/ / /获取某行某列的数据
/ / /行:行,行= 1代表第一行
/ / /颜色:列,col = 1代表第一列
/ / / /摘要
公共字符串这[行,int型]
{
得到
{
/ /数据有效性验证
CheckRowValid(行);
checkcolvalid(COL);
ArrayList煤=(ArrayList)这row-1 Rowal [ ];
/ /如果请求列数据大于当前行的列时,返回空值
如果(colal.count 西)
{
“回归”;
}
返回[Ⅰ] tostring()煤;
}
}
/ / /内容提要
/ / /根据最小行,最大行,最小列,最大列,来生成一个DataTable类型的数据
/ / /行等于1代表第一行
/ / /列等于1代表第一列
/ / / maxrow:- 1代表最大行
/ / / MAXCOL:- 1代表最大列
/ / / /摘要
这minrow公共DataTable [ int,int maxrow,int mincol,int MAXCOL ]
{
得到
{
/ /数据有效性验证
checkrowvalid(minrow);
checkmaxrowvalid(maxrow);
checkcolvalid(mincol);
checkmaxcolvalid(MAXCOL);
如果(maxrow = = 1)
{
maxrow =行数;
}
如果(MAXCOL = = 1)
{
MAXCOL = ColCoun
您可能关注的文档
- 规模大玩一场管理游戏(Big size play a management game).doc
- 规模养山羊要抓好四化(Scale goats should do a good job of the four modernizations).doc
- 规模的威力20天销售12000箱(Scale power 20 days sold 12000 boxes).doc
- 规章制度各项内容(The rules and regulations of the content).doc
- 规范机关秩序 改进干部作风 提高工作效率(Standardize the order of organs, improve the work style of cadres, and improve work efficiency).doc
- 视图修改准则(View modification criteria).doc
- 规模组织的地头力建设(Construction of scale and organization).doc
- 视阁设计机构客户答疑(Visual studio design agencies, customer Q & A).doc
- 规模化猪场免疫(Large-scale pig farm immunization).doc
- 角度看农村留守儿童的教育问题与对策(The educational problems and Countermeasures of left behind children in rural areas).doc
- 读《论语》--- 以企业培训礼示人和以果示人(Read the Analects of Confucius in enterprise training and the results shown in person).doc
- 读写大赛试题(Reading and writing contest).doc
- 读写结合是提高写作能力的重要途径 target=_blank(The combination of reading and writing is an important way to improve the writing ability of target=_blank).doc
- 读写译第一册unit4,5答案(Write the first volume unit4,5 answer).doc
- 读写文件(vb)(Read and write files (VB)).doc
- 读后感写法(Reading writing).doc
- 读地质图方法(Reading method of geological map).doc
- 读心神探与企业识人技巧(Read our knowledge and business skills).doc
- 读懂30条人生感悟,让你每天幸福相伴,快乐相随(Read the 30 life, let you every day happiness, happy hand in hand).doc
- 读懂面部微表情(Read facial micro expressions).doc
最近下载
- 中学地理学科课程标准与教材研究教学大纲.pdf VIP
- 中建X局各类建筑工程技术经济指标.docx VIP
- 我们的手上有多少细菌?.doc VIP
- 第一单元 观察物体 大单元教学设计2025数学人教版三年级上册(新教材).pdf
- 年东北财经大学国际商学院(校本部) 联招联考项目招生指南.pdf VIP
- 驾驶员安全生产操作规程 - 生产安全.docx VIP
- 公务员(国考)之行政职业能力测验题库附答案(基础题)收藏.docx VIP
- 全册部编版六年级上册全册道德与法治教学课件.pptx
- 第二章-空气流动压力及阻力.pptx VIP
- 2025年全国农产品质量安全检测技能竞赛理论知识考试题库(含答案.docx VIP
文档评论(0)