2024年9月26日 星期四

Word 合併列印 數字改為國字大寫 with excel

參考資料:https://fjanchen.blogspot.com/2010/11/blog-post_17.html


Word僅接受原始格式的文字,不接受Excel畫面上的格式設定,所以無法使用Excel的數值類型來設定數字的呈現格式.


在excel中處理:

1.必須要使用函數,確實將數字更改為大寫文字的文字型態,方能在Word中呈現出正確的數字

2.設定函數的方式為: =TEXT(原數字儲存格,"[DBNum2]")

3.其中的[DBNum2]代表國字大寫數字的格式定義


在word中處理:

1..滑鼠進入  數字  會出現反灰

2.按Shift- F9 會出現{ MERGEFIELD "數字" }

3.點進去 改成 { MERGEFIELD "數字" \* CHINESENUM2 }

4.按 F9 ,完成。


 word中其他格式:

\# 後面接的是數值性資料的格式

\@ 後面接的是日期性資料的格式

\*後面可接特殊的中文數字表示格式


譬如:

{ “合併欄位” \# NT$#,###.## }  將會顯示NT$12,345.78

{ “合併欄位” \* DBNUM1 }  將會顯示一二三四五六

{ “合併欄位” \* DBNUM2 }  將會顯示壹拾貳萬參仟肆佰伍拾陸

{ “合併欄位” \* DBNUM3 }  將會顯示一十二萬三千四百五十六


2024年7月8日 星期一

Using cmd powershell to du sub folders (Get sub folders size) 計算子目錄容量

powershell -command "$fso = new-object -com Scripting.FileSystemObject; gci -Directory -Depth 3 | select @{l='Size'; e={$fso.GetFolder($_.FullName).Size}},FullName | sort Size -Descending | ft @{l='Size [MB]'; e={'{0:N2}    ' -f ($_.Size / 1MB)}},FullName"


powershell -command "$fso = new-object -com Scripting.FileSystemObject; gci -Directory -Depth 2 | select @{l='Size'; e={$fso.GetFolder($_.FullName).Size}},FullName | sort Size -Descending | ft @{l='Size [KB]'; e={'{0:N2}    ' -f ($_.Size / 1KB)}},FullName"


powershell -command "$fso = new-object -com Scripting.FileSystemObject; gci -Directory -Depth 2 | select @{l='Size'; e={$fso.GetFolder($_.FullName).Size}},FullName | sort Size -Descending | ft @{l='Size [KB]'; e={'{0:N2}    ' -f ($_.Size / 1000)}},FullName"



reference:

https://stackoverflow.com/questions/12813826/get-folder-size-from-windows-command-line

https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.management/get-childitem?view=powershell-7.4


 Get-Content x.log -Wait -Tail 100

2024年2月17日 星期六

Using command line download google Chrome browser 免IE瀏覽器 使用命令列下載chrome瀏覽器

### cURL (Windows 10 built-in)
curl -fsSL "http://dl.google.com/chrome/install/chrome_installer.exe" > ChromeSetup.exe


### PowerShell Script 
powershell -Command "(new-object System.Net.WebClient).DownloadFile('http://dl.google.com/chrome/install/chrome_installer.exe','ChromeSetup.exe')"