procedure TForm1.btn1Click(Sender: TObject); var sFile,sLine: TStrings; r,c:Integer; begin sFile := TStringList.Create; sFile.LoadFromFile('d:\1.txt'); sLine := TStringList.Create; do begin sLine.CommaText := sFile[r]; do begin mmo1.Lines.Add(sLine[c…
using System; using System.Data; using System.Configuration; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; using System.D…
我之前写过一篇PHP读取csv文件的内容 上代码index.php <?php /** * * @author XC * */ class Excel { public $currentSheet; public $filePath; public $fileType; ; public $allColumn; public $allRow; public function initialized($filePath) { if (file_exists($filePath)) { $this-…
读取UTF-8格式的文件内容 function LoadUTF8File(AFileName: string): string; var ffileStream:TFileStream; fAnsiBytes: string; S: string; begin ffileStream:=TFileStream.Create(AFileName,fmOpenRead); SetLength(S,ffileStream.Size); ffileStream.Read(S[],Length(S));…
最近做了一个Upload文件的需求,文件的格式为CSV,读取文件的方法整理了一下,如下: 1.先写了一个读取CSV文件的Function: '读取CSV文件 '假设传入的参数strFile=C:\Documents and Settings\Administrator\桌面\TPA_Report1 - 副本.CSV Public Function Read_CSVFile(strFile As String) As ADODB.Recordset Dim rs As ADODB.Recordse…
Delphi读取Word现在关于往Word中写入数据的方法比较多,现在专门开个贴子,希望大家把自己读取Word内容的心得体会说一下,包括读取word文档中,有几个段落,如何读取第几个段落,读取有拼音的汉字,读取图片,读取表格等,希望大家不吝赐教! [解决办法]//启动Wordtrywordapplication1.connect;exceptmessagedlg('word may not be installed', mterror, [mbok], 0);abort;end;//打开文档pr…