I am trying to search and replace value within a huge file (40 millions) for the substring(30 characters) that starts at position 235 in a file called testfile.txt. I want to mask the substring with ("XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")
I am using the following command
sed -r 's/(.{235}).{30}(.*)/\1XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/g' testfile.txt > anothertestfile.txt
When I look at the output, there are some lines that the string was not replaced.