
i have a problem i am trying to print on a new line every time i reach a certain condition "if(line.startsWith("Creating"))" i want to skip that line and print out the rest of the lines.
my line input text looks like this
Creating
Finally, its time to write some code. Bookmark the Google APIs Add-On Javadocs for future reference. Integrating Google Maps is quite straightforward and can be achieved by extending the MapActivity class instead of the Activity class that we usually do.Activity responsibilities include:
Activity lifecycle management Setup and teardown of services behind a MapView
Creating
Finally, its time to write some code. Bookmark the Google APIs Add-On Javadocs for future reference. Integrating Google Maps is quite straightforward and can be achieved by extending the MapActivity class instead of the Activity class that we usually do.Activity responsibilities include:
Activity lifecycle management Setup and teardown of services behind a MapView
Creating
Finally, its time to write some code. Bookmark the Google APIs Add-On Javadocs for future reference. Integrating Google Maps is quite straightforward and can be achieved by extending the MapActivity class instead of the Activity class that we usually do.Activity responsibilities include:
Activity lifecycle management Setup and teardown of services behind a MapView
Creating
Finally, its time to write some code. Bookmark the Google APIs Add-On Javadocs for future reference. Integrating Google Maps is quite straightforward and can be achieved by extending the MapActivity class instead of the Activity class that we usually do.Activity responsibilities include:
Activity lifecycle management Setup and teardown of services behind a MapView
this is my code
package elite.tech.com;
/*********** * program Cvs * @author Alain ndayishimiye * @version 1 * @since 2012 **********/ import java.io.BufferedReader; import java.io.File; import java.io.FileOutputStream; import java.io.FileReader; import java.io.IOException; import java.io.PrintWriter;
public class Singleline extends Thread{ static String inpath = "C:\Users\ndayala\testin"; static String outpath = "C:\Users\ndayala\bin\bin.txt"; public static void runn1() throws IOException{
PrintWriter pw = new PrintWriter(new FileOutputStream(outpath ));// write to the outpath dir
File file = new File(inpath);//files from the inpath
File[] files = file.listFiles();//listFiles all file in inpath dir
for (int i = 0; i < files.length; i++) {
System.out.println("Processing " + files[i].getPath() + "... ");
BufferedReader br = new BufferedReader(new FileReader(files[i].getPath()));
String line = br.readLine();
while (line != null) {
System.out.println("writting:........"+files[i]);
char delim =',';
if(line.startsWith("Creating")){
pw.println(line);
}
line = br.readLine();
}
br.close();
}
pw.close();
System.out.println("your file have been concatenaded into one file under directory "+outpath);
//convert(outpath);
}
public static void main(String[]args) throws IOException{
runn1();
}
}