cat test.txt | grep d*og > filter.txt
將test.txt文字檔內,所有相關與d og有關之特定之字串,全部予以移除,並另存成filter.txt
GrepWin,視窗版 特定字串搜集/替代工具
2008年4月7日 星期一
將兩個文字檔案合併成一個檔
CAT file1.txt file2.txt > mergef1f2.txt
將file1.txt 與 file2.txt ,合併成一個檔案,其檔名為mergef1f2.txt
合併兼排序
Sort file1.txt file2.txt > Merge_Sortf1f2.txt
將file1.txt 與 file2.txt 合併,並且給予重新排序
將file1.txt 與 file2.txt ,合併成一個檔案,其檔名為mergef1f2.txt
合併兼排序
Sort file1.txt file2.txt > Merge_Sortf1f2.txt
將file1.txt 與 file2.txt 合併,並且給予重新排序
Diff (差分)比較兩個文字檔案之差異指令
(開放源碼)視窗版WinMerge分成左右視窗,可快速比較兩檔案間之差異,支援中文
diff orginal.txt modify.txt > comp.htm
orginal.txt 為原始檔案
modify.txt 為欲比較或修改過之檔案
comp.htm 為輸出兩個檔案比較之結果
相關Windows指令及運用(可將下面另存成 *.BAT批次檔):
REM 備份C槽舊有的通訊錄資料
%COMSPEC% /C copy "C:\PhoneAddress.htm" "C:\PhoneAddress.htm.bak" /y
REM 將example.com.tw網站擷取通訊錄資料,並將結果存放至D槽PhoneAddress_New.htm
%COMSPEC% /C wget -mkEpnp -e robots=off http://example.com.tw/PhoneAddress.htm -O "D:\PhoneAddress_New.htm"
REM 將比較結果存入D槽DiffMsg.txt
%COMSPEC% /C FC C:\PhoneAddress.htm D:\PhoneAddress_New.htm > D:\DiffMsg.txt
REM 顯示DiffMsg.txt比較結果
start /d"D:\" DiffMsg.txt
相關軟體:
DiffNow,線上/離線比對
DiffPDF,兩PDF檔案之內容相比較軟體
AptDiff, 兩文字檔/執行檔之內容相比較軟體
(開放源碼)DiffImg,2圖檔比較,
(開放源碼)diff-ext,
(開放源碼)KDiff3,可進行檔案、目錄比對及合併功能
Juan M. Aguirregabiria Directory Compare,可對來源與目的兩資料夾間之檔案進行比對
inicmd,可協助以命令提示方式進行ini參數資訊建立,刪除及兩ini檔之比對等功能
TextDiff
日文查詢問句-->A與B有何不同?
AとBの違いは何ですか?
AとBはいったい何が違うんだ?
A與B性能差異比較?
AとB の性能の差は 比較し
diff orginal.txt modify.txt > comp.htm
orginal.txt 為原始檔案
modify.txt 為欲比較或修改過之檔案
comp.htm 為輸出兩個檔案比較之結果
相關Windows指令及運用(可將下面另存成 *.BAT批次檔):
REM 備份C槽舊有的通訊錄資料
%COMSPEC% /C copy "C:\PhoneAddress.htm" "C:\PhoneAddress.htm.bak" /y
REM 將example.com.tw網站擷取通訊錄資料,並將結果存放至D槽PhoneAddress_New.htm
%COMSPEC% /C wget -mkEpnp -e robots=off http://example.com.tw/PhoneAddress.htm -O "D:\PhoneAddress_New.htm"
REM 將比較結果存入D槽DiffMsg.txt
%COMSPEC% /C FC C:\PhoneAddress.htm D:\PhoneAddress_New.htm > D:\DiffMsg.txt
REM 顯示DiffMsg.txt比較結果
start /d"D:\" DiffMsg.txt
相關軟體:
DiffNow,線上/離線比對
DiffPDF,兩PDF檔案之內容相比較軟體
AptDiff, 兩文字檔/執行檔之內容相比較軟體
(開放源碼)DiffImg,2圖檔比較,
(開放源碼)diff-ext,
(開放源碼)KDiff3,可進行檔案、目錄比對及合併功能
Juan M. Aguirregabiria Directory Compare,可對來源與目的兩資料夾間之檔案進行比對
inicmd,可協助以命令提示方式進行ini參數資訊建立,刪除及兩ini檔之比對等功能
TextDiff
日文查詢問句-->A與B有何不同?
AとBの違いは何ですか?
AとBはいったい何が違うんだ?
A與B性能差異比較?
AとB の性能の差は 比較し
將程式自動加入行號之指令
cat - n original.txt > newline.txt
original.txt 為原先欲加入行號之檔案
newline.txt 為透過Cat指令處理後,自動加入行號
original.txt 為原先欲加入行號之檔案
newline.txt 為透過Cat指令處理後,自動加入行號
計算兩個日期間之天數函數
微軟提供的函數ElapsedTimeString
http://office.microsoft.com/zh-tw/access/HA011102181028.aspx
由Access改成以Excel方式來處理
步驟1:以Excel開啟,並預先指定好各欄位
步驟2:按Alt+F11開啟VB編輯器
步驟3: 由主選單選擇 插入| 模組
並且將微軟相關提供之函數,放置於此處,以便該Excel VBA去呼叫
步驟4:由主選單之 檢視(V) | 工具列(T) | 選擇 控制工具箱 ,並加入一個 指令按鈕,筆者將此按鈕命名為 BtnComputeDate,系統即可透過該函數,自動計算兩日期間之相差
Private Sub BtnComputeDate_Click()
Application.ScreenUpdating = False '暫時關閉即時顯示畫面,避免畫面一直閃動
intRow = 2 '跳過第1列(標題),由第2列開始處理
Do Until Cells(intRow, 1).Value = "" '設置迴圈,一直執行到沒有資料為止
Cells(intRow, 5).Value = "" '先清除合約開始至區段查詢天數
Cells(intRow, 5).Value = ElapsedTimeString(Cells(intRow, 2).Value, Cells(intRow, 4).Value)
Cells(intRow, 6).Value = "" '先清除合約開始至合約結束天數
Cells(intRow, 6).Value = ElapsedTimeString(Cells(intRow, 2).Value, Cells(intRow, 3).Value)
Cells(intRow, 7).Value = "" '先清除執行比例
Cells(intRow, 7).Value = Cells(intRow, 5).Value / Cells(intRow, 6).Value
intRow = intRow + 1 '處理下一筆資料
Loop
Application.ScreenUpdating = True
End Sub
http://office.microsoft.com/zh-tw/access/HA011102181028.aspx
由Access改成以Excel方式來處理
步驟1:以Excel開啟,並預先指定好各欄位
流水號 (必填欄位, 可任意值不能空白) | 合約開始日 | 合約結束日 | 區段查詢日 | 合約開始 至區段查詢服務天數 | 合約總服務天數 | 合約目前執行比例 =E1 / F1 |
10248 | 2004/9/20 | 2007/3/19 | 2006/12/31 | |||
11083 | 2006/1/16 | 2007/1/15 | 2006/12/31 |
步驟2:按Alt+F11開啟VB編輯器
步驟3: 由主選單選擇 插入| 模組
並且將微軟相關提供之函數,放置於此處,以便該Excel VBA去呼叫
步驟4:由主選單之 檢視(V) | 工具列(T) | 選擇 控制工具箱 ,並加入一個 指令按鈕,筆者將此按鈕命名為 BtnComputeDate,系統即可透過該函數,自動計算兩日期間之相差
Private Sub BtnComputeDate_Click()
Application.ScreenUpdating = False '暫時關閉即時顯示畫面,避免畫面一直閃動
intRow = 2 '跳過第1列(標題),由第2列開始處理
Do Until Cells(intRow, 1).Value = "" '設置迴圈,一直執行到沒有資料為止
Cells(intRow, 5).Value = "" '先清除合約開始至區段查詢天數
Cells(intRow, 5).Value = ElapsedTimeString(Cells(intRow, 2).Value, Cells(intRow, 4).Value)
Cells(intRow, 6).Value = "" '先清除合約開始至合約結束天數
Cells(intRow, 6).Value = ElapsedTimeString(Cells(intRow, 2).Value, Cells(intRow, 3).Value)
Cells(intRow, 7).Value = "" '先清除執行比例
Cells(intRow, 7).Value = Cells(intRow, 5).Value / Cells(intRow, 6).Value
intRow = intRow + 1 '處理下一筆資料
Loop
Application.ScreenUpdating = True
End Sub
訂閱:
文章 (Atom)