3

Visual Studio 2010 を使用して C# で新規作成し、Excel シートからテキスト ファイルに出力しようとしています。Excel シートには、次のような数値を持つ列が 1 つだけ含まれています。

ColumnA
-------
222
333
444
555
666
777
888
999
877
566
767
678
767

次のようなテキスト ファイルで出力を取得しようとしています。

222, 333, 444, 
555, 666, 777, 
888, 999, 877, 
566, 767, 678,
767

前もって感謝します。

4

1 に答える 1

1

これは、BytesCout SpreadSheet SDKを使用して行う必要があります。

using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
using Bytescout.Spreadsheet;

namespace Converting_XLS_to_TXT
{
class Program
{
static void Main(string[] args)
{
// Create new Spreadsheet from SimpleReport.xls file
Spreadsheet document = new Spreadsheet("SimpleReport.xls");

// delete output file if exists already
if (File.Exists("SimpleReport.txt")){
File.Delete("SimpleReport.txt");
}

// save into TXT
document.Workbook.Worksheets[0].SaveAsTXT("SimpleReport.txt");

}
}
}

参考文献:

于 2012-07-17T18:43:11.200 に答える