function SaveTxtBody($ds)
{
$txtBody = ""
foreach ($item in $ds.Tables[0].Rows)
{
$line = ""
for ($index = 0; $index -lt $ds.Tables[0].Columns.Count; $index++) {
$line += $item[$index]
if (!($index -eq ($ds.Tables[0].Columns.Count -1)))
{
$line += ","
}
}
$txtBody += $line
$txtBody += [char]13+[char]10 # 換行符號
}
$txtBody > $pathSampleFile
}