vinnyMS Posted December 13, 2020 Posted December 13, 2020 hi, i need a script that can replace words in text files based on a two column ("before" column and "after" column) word list (.txt) separated by TAB the list contains Chinese language words for example: @2m07_dfmain1 @ryog @2m07_参加活动3 @pvex @2m07_参加活动4 @kgyn @2m07_参加活动5 @qxsp @2m07_参加活动6 @wblf @2m07_娲诲姩缁撴潫 @gupm @2m07_寮€濮嬮濂? @tkfk
Subz Posted December 14, 2020 Posted December 14, 2020 Use StringSplit or _FileReadToArray using @Tab as the delimiter should create an array, then loop through the array and use stringreplace.
FrancescoDiMuro Posted December 15, 2020 Posted December 15, 2020 @vinnyMS The words On 12/13/2020 at 11:54 PM, vinnyMS said: i need a script and no code provided are not really close friends in these Forums Click here to see my signature: Spoiler ALWAYS GOOD TO READ: Forum Rules Forum Etiquette
vinnyMS Posted December 15, 2020 Author Posted December 15, 2020 (edited) here is a script to start expandcollapse popup#Region INCLUDE #include <AVIConstants.au3> #include <GuiConstantsEx.au3> #include <TreeViewConstants.au3> #EndRegion INCLUDE #Region GUI GUICreate("Replace words", 400, 350) GUISetIcon(@SystemDir & "\notepad.exe", 0) #EndRegion GUI #Region PROGRESS GUICtrlCreateProgress(10, 310, 300, 20) GUICtrlSetTip(-1, '#Region PROGRES') GUICtrlSetData(-1, 60) GUICtrlCreateLabel("Progress:", 5, 82) GUICtrlSetTip(-1, '#Region PROGRES - Label') #EndRegion PROGRESS #Region LIST VIEW Local $idListView = GUICtrlCreateListView("Before|After|", 10, 45, 300, 250) GUICtrlSetTip(-1, '#Region LIST VIEW') GUICtrlCreateListViewItem("cat|dog", $idListView) GUICtrlCreateListViewItem("tree|hair", $idListView) GUICtrlCreateListViewItem("spoon|house", $idListView) #EndRegion LIST VIEW #Region INPUT GUICtrlCreateInput("C:\", 10, 10, 300, 20) GUICtrlSetTip(-1, '#Region INPUT') #EndRegion INPUT #Region BUTTON GUICtrlCreateButton("Browse", 330, 10, 50, 20) GUICtrlSetTip(-1, '#Region BUTTON') #EndRegion BUTTON #Region BUTTON GUICtrlCreateButton("Import", 330, 45, 50, 20) GUICtrlSetTip(-1, '#Region BUTTON') #EndRegion BUTTON #Region BUTTON GUICtrlCreateButton("Replace", 330, 310, 50, 20) GUICtrlSetTip(-1, '#Region BUTTON') #EndRegion BUTTON #Region GUI MESSAGE LOOP GUISetState(@SW_SHOW) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop EndSwitch WEnd GUIDelete() #EndRegion GUI MESSAGE LOOP Edited December 15, 2020 by vinnyMS
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now