I need to replace a particular character in a text file with another character. For example, replacing “E” with “A”:
Apple ice→ApplA Ica
While executing sed 's/E/A' < apple.txt > app.txt I receive the error
function cannot be parsed
Please help! I need to automate this using Antscript.
Since you are in Ant environment, you probably don’t need to execute sed at all, but rather use Copy task with filter, or ReplaceRegExp task.
This alters the file in place:
Your example is strange with case (a|A, e|E). I’ll assume that’s typo.
Follow up: To declare encoding…
I tested this successfully. Before:
After: