java - How can i show it at first? -


I have written a simple Java application, I have a problem Please help me;

I have a file (example only):

  1.TXT ------- SET MRED: NAME = MRED: 0, MREDID = 60; Set BTT: NAME = BCT: 0, NEPE = DCS, T2 = 5, DK0 = Core; Create LCD: NAME = LCD: 0; -------  

And this is my source code

  import java.io.IOException; Import java.io * *; Import java.util.StringTokenizer; Class 1 exam {Private Final Ent FLUSH_LIMIT = 1024 * 1024; Private stringbuilder outputbuffer = new string builder (FLUSH_LIMIT + 1024); Public static zero main (string [] args throws IOException {test1p = new test1 (); String filename = "i: \\ 1 \\ 1.txt"; File file = new file (filename); Buffettder br = new buffed reader (new filereader (file)); String line; While ((line = breadline ()) = null (string string) = string string new (new string signifier); While (st.hasMoreTokens ()) {string token = st.nextToken (); P.processToken (token); }} P.flushOutputBuffer (); } Private Zero process token (string token) {if (token.startsWith ("MREDID =")} {string value = getTokenValue (token, "="); OutputBuffer.append ("MREDID:") enclosed (value) .append ("\ n") ;. } And if (token.startsWith ("DK0 =") {string value = getTokenValue (token, "="); OutputBuffer.append ("DK0 =:") Attached (value) .append ("\ n") ;. } And if (token.startsWith ("NEPE =")) {string value = getTokenValue (token, "="); OutputBuffer.append ("NEPE:") enclosed (value) .append ("\ n") ;. } If (outputbuffer.length () & gt; FLUSH_LIMIT) {flushOutputBuffer (); }} Private string getTokenValue (string token, find string) {int start = token.indexOf (find) + 1; Int end = token.length (); String value = token. Substring (start, end); return value; } Private Zero FlushOutputBuffer () {System.out.print (outputBuffer); Output buffer = new string builder (FLUSH_LIMIT + 1024); }}  

I want this output:

  MREDID: 60 DK0 =: KOR NEPE: DCS  

but This app shows me this:

  MREDID: 60 NEPE: DCS DK0 = KOR  

Please tell me how to do this because of that DK 0 I can handle it first and this is just a sample; My true application has 14000 lines

thanks ...

outputting instead When you read it, keep it in a hush. Once you've read your entire file, get the output based on the values ​​received from the helmpe.


Comments

Popular posts from this blog

oracle - The fastest way to check if some records in a database table? -

php - multilevel menu with multilevel array -

jQuery UI: Datepicker month format -