I tried the code below but it doesn't work. Nevertheless, if I try to cat the file, it works and prints the whole content of the file.
But the reason I tried using awk is that I don't need the whole content, I only need some parts of each line.
Runtime r = Runtime.getRuntime();
Process p = r.exec("awk -F\":\" '/in/ {print $3}' file.awk");
p.waitFor();
BufferedReader in=new BufferedReader(new InputStreamReader(p.getInputStream()));
System.out.println("esto es una \"prueba\"");
String valor = "";
while ((valor = in.readLine())!= null){
System.out.println(valor);
}