1 57 58 package util; 59 60 import java.io.*; 61 62 65 public class GetQueues { 66 67 public static void main(String [] args) { 68 69 if ( args.length != 2 ) { 70 System.err.println( "usage: GetQueues infile outfile" ); 71 System.exit( 1 ); 72 } 73 74 try { 75 BufferedReader input = new BufferedReader(new FileReader( args[0] ) ); 76 BufferedWriter output = new BufferedWriter(new FileWriter( args[1] ) ); 77 78 String s, qn; 79 while ((s = input.readLine()) != null) { 80 s = s.trim(); 81 if ( s .startsWith( "QUEUE(" ) ) { 82 qn = s.substring( 6, s.indexOf( ")" ) ); 83 output.write( "DELETE QLOCAL(" + qn + ")\n" ); 84 } 85 } 86 87 input.close(); 88 output.close(); 89 90 } catch (Exception ex) { 91 ex.printStackTrace(); 92 } 93 94 } 95 96 } | Popular Tags |