Browse Source

Funciona pero sobreescribe los datos y solo para cuando le metes la

barra sola
master
vigliom 2 years ago
parent
commit
4da2f20db0
3 changed files with 24 additions and 0 deletions
  1. +7
    -0
      FichTexto.txt
  2. BIN
      bin/jorpelu/com/main.class
  3. +17
    -0
      src/jorpelu/com/main.java

+ 7
- 0
FichTexto.txt View File

@ -0,0 +1,7 @@
asdawd
wadsaad
wad
awd
awdawdaw
aw\

BIN
bin/jorpelu/com/main.class View File


+ 17
- 0
src/jorpelu/com/main.java View File

@ -0,0 +1,17 @@
package jorpelu.com;
import java.io.*;
import java.util.Scanner;
public class main {
public static void main(String[] args) throws IOException {
File fichero = new File("FichTexto.txt");
FileWriter fic = new FileWriter(fichero);
Scanner sc = new Scanner(System.in);
String cad = " ";
do {
fic.write(cad + "\n");
}while((cad=sc.next()).toCharArray()[0] != '\\');
fic.close();
}
}

Loading…
Cancel
Save