I have this method that can read everything within a file but i need to be able to first add one whitespace before every new char at the beginning of everyline.
Tried to make it as easy as possible but non of it seem to work.
private static void write() throws IOException {
FileWriter fw = new FileWriter("C:\\Users\\karwa\\Desktop\\HistoryOfProgramming.txt");
for (int i = 0; i < 15; i++) {
fw.write(" ");
}
fw.close();
}
Used bufferedReader aswell that had a whileloop that was reading every line and adding one whitespace for each line but that didn't work either. Ideas?