2016-07-15 83 views
0

我想要在特定的sheeet上顯示正則表達式搜索的結果作爲另一個工作表上的列。 (例如,有條件的突出顯示或某事)並不難,只是要看看結果在哪裏,但我真正需要的東西(對於我完美的GTD電子表格!)是能夠使自動生成的列包含例如所有攜帶例如標籤@home或#projectname。在過去的生活中,我打開了Access(這是微軟所做的一件事,它並不完全吸引人!),但是使用LibreOffice Base基本上是一次長時間的崩潰,並且加上用戶體驗電子表格令人愉快地靈活。建議歡迎。我是Linux專用的atm。返回某個區域中的匹配列表作爲列

回答

0

使用LibreOffice的基地基本上是一個長崩潰

你試過底座採用拆分數據庫設置,如MySQL的?運行嵌入式HSQLDB是not recommended

反正這裏是一些Python代碼,你想要做什麼:

def calc_regex_to_column(): 
    desktop = XSCRIPTCONTEXT.getDesktop() 
    model = desktop.getCurrentComponent() 
    sheet_src = model.getSheets().getByIndex(0) 
    sheet_dst = model.getSheets().getByIndex(1) 
    search = sheet_src.createSearchDescriptor() 
    search.SearchString = r".*@home|#projectname.*" 
    search.SearchCaseSensitive = True 
    search.SearchRegularExpression = True 
    selsFound = sheet_src.findAll(search) 
    sheet_dst_row = 0 
    for selIndex in range(0, selsFound.getCount()): 
     string_found = selsFound.getByIndex(selIndex).getString() 
     COLUMN_A = 0 
     cell = sheet_dst.getCellByPosition(COLUMN_A, sheet_dst_row) 
     cell.setString(string_found) 
     sheet_dst_row += 1 

g_exportedScripts = calc_regex_to_column, 

here對在何處放置腳本。

相關問題