Is there any way i can filter out lines containing a certain word that i do not want? For example an example output would be
E/MediaPlayer( 7616): error (1, -2147483648)
D/MediaPlayer( 7616): create failed:
D/MediaPlayer( 7616): java.io.IOException: Prepare failed.: status=0x1
D/MediaPlayer( 7616): at android.media.MediaPlayer.prepare(Native Method)
D/MediaPlayer( 7616): at android.media.MediaPlayer.create(MediaPlayer.java:632)
D/MediaPlayer( 7616): at android.media.MediaPlayer.create(MediaPlayer.java:609)
However i only want the first three lines without the “at” in them to be written into the StringBuilder. Is there any way to filter out lines containing the word “at”?
while ((finalresult = bufferedReader.readLine()) != null) {
log.append("Error for file: "+ location.toString() + " " + finalresult + "\n");
where regex is regular expression and is described more here: http://developer.android.com/reference/java/util/regex/Pattern.html