# 複数のテキストファイルを一つのデータテーブルへ合体したい

**URL:** <https://forum.uipath.com/t/topic/344935>\
**Category:** フォーラム\
**Tags:** question\
**Created:** [September 14, 2021, 8:13am UTC](https://forum.uipath.com/t/topic/344935 "2021-09-14T08:13:46Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![taniguchi.michio](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/taniguchi.michio/32/176959_2.png) [@taniguchi.michio](https://forum.uipath.com/u/taniguchi.michio)\
**Post date:** [September 14, 2021, 8:13am UTC](https://forum.uipath.com/t/topic/344935/1 "2021-09-14T08:13:46Z")

</div>

特定のフォルダにあるcsvファイルを連続に読込み、一つのデータテーブルに追加。  
最後にExcelファイルに書き込み仕様です。  
データテーブルに行単位で追加する方法は分かるのですがファイル単位で追加する方法が分かりません。  
１件目のcsvはExcelWriteRangeでデータターブルに保存、２件目もファイル単位でデータテーブルに保存したいのですが。  
どなたかアドバイスを頂けないでしょうか。

---

<div class="post-metadata">

**Author:** ![Yoichi](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/yoichi/32/523754_2.png) [@Yoichi](https://forum.uipath.com/u/Yoichi)\
**Post date:** [September 14, 2021, 8:18am UTC](https://forum.uipath.com/t/topic/344935/2 "2021-09-14T08:18:32Z")

</div>

こんにちは

要件がいまいち不明確なような気がしますが、

同じスキーマの２つのDataTableを一つに結合するのであれば

MergeDataTable

> **[データ テーブルをマージ (Merge Data Table)](https://docs.uipath.com/activities/lang-ja/docs/merge-data-table)**
>
> UiPath.Core.Activities.MergeDataTable Merges the Destination with the Source, indicating whether to preserve changes and how to handle missing schema in the Source. Properties Common DisplayName - The display name of the activity. Input Destination -...

エクセルのシートに都度DataTableを追記していくのであれば

AppendRange

> **[Append Range](https://docs.uipath.com/activities/docs/excel-append-range)**
>
> UiPath.Excel.Activities.ExcelAppendRange Adds the information stored in a DataTable variable to the end of a specified Excel spreadsheet. If the sheet does not exist, a new one is created with the name indicated in the SheetName field. Properties...

が使えるかと思います。

---

<div class="post-metadata">

**Author:** ![taniguchi.michio](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/taniguchi.michio/32/176959_2.png) [@taniguchi.michio](https://forum.uipath.com/u/taniguchi.michio)\
**Post date:** [September 15, 2021, 4:27am UTC](https://forum.uipath.com/t/topic/344935/3 "2021-09-15T04:27:38Z")

</div>

Yoichiさん、回答ありがとうございます。

Merge Data Tableで解決出来ました。  
複数のテキストファイルを一つのファイルに作成できる事が出来ました。

ありがとうございました。
