Please help me, I have been in this mess since long now. I have 2 files, one from which i pick up text and the other which i span to replace the text in.
i was tryin it with regular expressions but i failed without any error messages. please help. Creating scenario below:
I have a variable calculated substrVersion inside a loop while reading 1st file.
Inside the same, I create a second loop for 2nd file, reading it if it finds any occurance of "FileVersion" and I try to replace it with regular expression:
CharSequence inputStr = "codebase='formbuilderocx.cab#version=4,2,0,0' viewastext id='formbuilderocx' >"; // "a b c a b c";
String patternStr = "[0-9][0-9]+(,[0-9][0-9]){3}"; //"a";
String replacementStr = "3,7,0,5";
// Compile regular expression
Pattern pattern = Pattern.compile(patternStr);
// Replace all occurrences of pattern in input
Matcher matcher = pattern.matcher(inputStr);
String output = matcher.replaceAll(replacementStr);
BUT I donot get any updated output string.
Then i tried it the other way round dealing with indexes and appending substrings into an updated new string.
BUT now i cannot replace the string in 2nd file with the new one. When i update 1 line , the other which passes the condition (but was updated in last loop round) is overwritten with old text.
plesae help, i dont know how to embedd mrakers in the file so that tyhe text whichis updated do not get over written when i run the readline again for 2nd updation...
