I have requirement to copy content from one file to another. So is my below code. But the additional requirement is that the second character in every line should be checked and changed to character 'X'. Please let me know how can this be checked.
Then read the file line by line, modify the line (warning: what if the line has 0 or 1 characters?) and write it to the file (using FileWriter). Don't forget to add new line breaks yourself, because most (all?) line reading classes strip away the line breaks.