Notepad file name *.properties attribute change dynamically
I have file name listoffilesloca
Content:
C:\POC\1.txt
C:\POC\2.txt
I have another file name application.
Content:
extn=.tiff
inputfilelocation= C:\POC\test.txt
size=5kb
Problem :
Need to modify the inputlocation with C:\POC\1.txt, C:\POC\2.txt sequentially and save the application.
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- Sikuli Edit question
- Assignee:
- No assignee Edit question
- Solved by:
- Anup K
- Solved:
- 2019-11-18
- Last query:
- 2019-11-18
- Last reply:
- 2019-11-18
Anup K (anupk) said : | #1 |
Please let me know. Thanks in advance!!
Mike (maestro+++) said : | #2 |
Sikulix's special claim to fame is it scripts visual interfaces. So you need to choose visual interfaces. So the first thing is to run through the process manually. From that, you can decide how to automate the process.
In your case you might use Wordpad to open listoffilesloca
Anup K (anupk) said : | #3 |
Thanks Mike for clarifying it.
I need additional information regarding Sikulix to solve the below problem :
1)How to identify properies named "inpitfilelocation"
2) identify the location of value after "="
3)cut/paste command in sikulix
After that I can take care of save and other operaion.
Need example to
Anup K (anupk) said : | #4 |
Solve the steps in Sikulix. ( Sorry for the new message) . By mistake I posted previous one.
Thanks for your understanding.
RaiMan (raimund-hocke) said : | #5 |
Normally you use Python/Jython for scripting yopur workflows.
Since I guess, that the mentioned files are accessible text files, you can simply use file i/O (open/read/
So no need, to do it visually.
Mike (maestro+++) said : | #6 |
To add to Raiman's point, if you don't specifically want to use surface automation (as with Sikulix) there are many API or Windows based libraries you can use to automate things. "Automate the Boring Stuff with Python" is a popular book, and indeed has a chapter on pyautogui which does a lot of what Sikulix does.
Anup K (anupk) said : | #7 |
Thanks for your input.
Yeah Mike and RaiMan I can do automation in different way. But idea was to explore on the Surface automation using SikuliX for below problem as I mentioned in previous thread. That will definitely help on other opportunity.
1)How to identify properties named "inputfilelocation"
2)Identify the location of value after "="
3)Cut/paste command in SikuliX
If you can answer it that would be helpful. Please let us know for any concern.
RaiMan (raimund-hocke) said : | #8 |
Again and finally:
use the standard File-I/O methods to access/modify text files.
Effort: about 10-20 lines of code, 1 hour development and testing
solution is 100% reliable and portable in every environment
Why:
It does not make sense to solve this with surface automation, because it is rather complex and not 100% reliable (using OCR for cases, where there are other means to get the text directly).
For your case, I guess the effort: about 30 - 50 lines of code, 3+ hours for development and testing.
... and is not 100% reliable and is not portable in other environments, that have different pixel setups.
Anup K (anupk) said : | #9 |
Thanks RaiMan. Closing the issue.