Trying to change name="Android" to name="Android1", name="Android2" and so on..
Will need to run my python script using the command line on windows, macOS and Linux.
Output2.xml
<?xml version="1.0" encoding="UTF-8"?>
<robot generator="Robot 2.9 (Python 3.6.8 on linux)" generated="20190701 08:47:35.439">
<suite id="s1" name="Android" source="/FILEPATHHERE">
#ommitted unrelevant lines from xml file
Problem
I have tried a couple of ways listed on Stackoverflow but realized that it is not as easy as it seems.
Was just trying the ways using my mac terminal and when I tried running this:
sed -i 's/android/newtext' output2.xml
Error: sed: 1: "output2.xml": invalid command code o
Added in '' but another new error came up:
sed -i '' 's/android/newtext' output2.xml
Error: sed: 1: "s/android/newtext": unterminated substitute in regular expression
Can I use sed commands? Seems like I am doing it wrong as I have some issues in editing XML using sed commands.
Main References
https://askubuntu.com/questions/20414/find-and-replace-text-within-a-file-using-commands https://superuser.com/questions/916665/edit-xml-file-using-shell-script-command