[英]Excel to copy / paste some cells from one sheet to another but with a twist
[英]Copy cells from excel sheet and paste it to a DB query Sikuli
我是Sikuli的新手。 我需要從excel工作表中復制數據,然后使用sikuli腳本將其粘貼到數據庫查詢中。 以及如何在Excel單元格之間迭代以重復復制和粘貼數據。
這些數據需要一個接一個地復制和粘貼。
一次復制所有單元格,然后將它們一個個粘貼,可能會更容易。
一旦Sikuli打開Excel,您可以執行以下操作:
type(Key.HOME, KeyModifier.CTRL) #takes you to cell A1
type("a", KeyModifier.CTRL) #select all
type("c", KeyModifier.CTRL) #copy to clipboard
fromExcel = Env.GetClipboard().strip() #get clipboard contents into Sikuli, without leading or trailing white space
cells = fromExcel.split("/n") #split each cell into list on newline
#go to the destination app, maybe using App.open("nameOfYourApp") if it's not open yet, or App.focus("nameOfYourApp") if it is already open
for cell in cells: #use python to iterate through your list
#navigate to the line or cell where you want to paste
paste(cell)
這樣的事會有幫助嗎?
除了提供特定的方法外,讓我們了解一下您所擁有的選項。
注意 :在所有情況下,您顯然都必須考慮如何將自己帶到屏幕上有打開的Excel工作表以及完成后如何處理它。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.