PB中怎樣把資料寫到已經固定格式的EXCEL表中

2021-06-16 01:25:38 字數 2217 閱讀 1426

int i,handle,n

handle = openchannel("excel",'book1.xls')

if handle < 0 then

messagebox('提示','請開啟excle程式! 並開啟book1.xls,且清空該**!')

return

end if

setremote('r1c1' , '客戶欠費分析表'     , handle)

setremote('r2c5' , '統計日期: ' + is_rq1 + ' 至 ' + is_rq2    , handle)

setremote('r3c1' , '排名' , handle)

setremote('r3c2' , '客戶碼' , handle)

setremote('r3c3' , '客戶名稱' , handle)

setremote('r3c4' , '應收總額' , handle)

setremote('r3c5' , '欠費總額' , handle)

setremote('r3c6' , '比率' , handle)

setremote('r3c7' , tab_1.tabpage_1.dw_1.object.no1_t.text , handle)

setremote('r3c8' , tab_1.tabpage_1.dw_1.object.no2_t.text , handle)

setremote('r3c9' , tab_1.tabpage_1.dw_1.object.no3_t.text , handle)

setremote('r3c10', tab_1.tabpage_1.dw_1.object.no4_t.text , handle)

setremote('r3c11', tab_1.tabpage_1.dw_1.object.no5_t.text , handle)

for i = 1 to tab_1.tabpage_1.dw_1.rowcount()

setremote("r" + string(i+3) + 'c1' , string(i) , handle)

setremote("r" + string(i+3) + 'c2' ,    tab_1.tabpage_1.dw_1.getitemstring (i , 'khbm') , handle)

setremote("r" + string(i+3) + 'c3' ,    tab_1.tabpage_1.dw_1.getitemstring (i , 'khmc') , handle)

setremote("r" + string(i+3) + 'c4' , string(tab_1.tabpage_1.dw_1.getitemdecimal(i , 'ys')) , handle)

setremote("r" + string(i+3) + 'c5' , string(tab_1.tabpage_1.dw_1.getitemdecimal(i , 'qf')) , handle)

setremote("r" + string(i+3) + 'c6' , string(tab_1.tabpage_1.dw_1.getitemdecimal(i , 'bl')) , handle)

setremote("r" + string(i+3) + 'c7' , string(tab_1.tabpage_1.dw_1.getitemdecimal(i , 'no1')) , handle)

setremote("r" + string(i+3) + 'c8' , string(tab_1.tabpage_1.dw_1.getitemdecimal(i , 'no2')), handle)

setremote("r" + string(i+3) + 'c9' , string(tab_1.tabpage_1.dw_1.getitemdecimal(i , 'no3')) , handle)

setremote("r" + string(i+3) + 'c10', string(tab_1.tabpage_1.dw_1.getitemdecimal(i , 'no4')) , handle)

setremote("r" + string(i+3) + 'c11', string(tab_1.tabpage_1.dw_1.getitemdecimal(i , 'no5')) , handle)

next

closechannel(handle)

messagebox('提示','儲存完畢!')

**:

利用Shell 對固定格式的txt檔案資料進行脫敏

文件格式如下圖,所有列都是以 進行分割,需要對指定列進行替換脫敏,嘗試用 sed 來進行替換,但多次嘗試以後無果,原因在於,需要處理的資料多列,資料有中文,數字還有其他的格式,替換必須要有乙個原始資料,所以sed無法滿足我的需求 嘗試使用awk來對資料進行查詢替換,最後也是多次嘗試無果,雖然能夠把指...

把Excel中的資料插入到資料庫中已經存在的表中

首先,建立乙個表 sql view plain copy print?create table aaa name varchar 10 user id varchar 20 create table aaa name varchar 10 user id varchar 20 然後插入數值 注意要轉...

用SQLPLUS以指定格式輸出表中的資料到文字檔案

用sqlplus以指定格式輸出表中的資料到文字檔案 set term off 去掉螢幕顯示 set feed off 去掉顯示輸出的行數 set pagesize 0 不換頁 set linesize 2000 設定行的長度,保證能夠顯示輸出的所有的字段長度的和 set space off 設定輸出...