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
}
2008/10/27
PowerShell : 換行符號
以下範例是將dataset一行一行的存入text file:
訂閱:
文章 (Atom)
-
一個糖果有一個糖果紙 一個糖果1元 現在商店在作促銷 3個糖果紙可以換1個糖果 請問 15元最多可以吃幾個糖果?
-
以前在用SQL 2000時,Restore db都是先新增一個空的db,然後再按還原資料庫, 但是換到SQL 2005時,這樣做卻會失敗, 所以現在如果你的資料庫是使用SQL 2005,還原資料庫時不用再新增一個空的db了, 1.直接在「物件總管」中的「資料庫」上按右鍵,選取「...
-
首先你要先安裝好informix的ODBC Driver並且設定可以連結到informix db。開啟Enterprise Manager後,找到連結伺服器(SQL Server群組-->安全性),按右鍵「新增連結伺服器」: 提供者名稱:Microsoft OLE D...
