My OUTPUT (... looks greek to me, need it in English)

my output looks like this:
a >???�??????�??�??�?????�?????????????
it should have looked like this:
0001 06/12/1982 01 02 03 04 05 06 07
Here is my code, its a work in progress, presently im just trying to get one line to print out... then i will add other functions to it.
Your Database:
recID mm/dd/ccyy n1 n2 n3 n4 n5 n6 n7
0001  06/12/1982 01 02 03 04 05 06 07
0002  06/12/1982 02 03 04 05 06 07 43
0003  06/12/1982 03 10 12 21 14 41 43
0004  06/12/1982 04 11 16 22 14 41 43
0005  06/12/1982 05 12 17 23 14 41 43
The program: Compares each line(record) and finds records that contain 6 of the same numbers
So in the above database, it should find that rec1 & rec2 contain 6 same numbers
Basic Algorithm:
read in rec1, all 5 records compared against rec1
read in rec2, remaining 4 records compared against rec2
read in rec3, remaining 3 records compared against rec3
for each Record{
   compare to next record
   if 6 numbers the same
      write it out
   else
      get next record to compare
}//endof ForEachRecord
import java.io.*;
public class Find6same
     public static void main( String args[]) throws IOException
          int n = 0;
          int RECORD_SIZE = 36;
      long start = 0L;
      char c;
      //create 2 stringbuffers for holding & comparing records
      StringBuffer a = new StringBuffer(36); //holds current record
      StringBuffer b = new StringBuffer(36); //holds record to compare
      //create the pw stream for output
      File outputFile = new File("C:\\jLotto\\dataFile\\find6.txt");
          PrintWriter pw = new PrintWriter( new FileWriter( outputFile ));
      //create the random access stream for reading & processing
          RandomAccessFile in = new RandomAccessFile("C:\\jLotto\\dataFile\\numberOfBytesIn.txt","r");
      // get the position at which the next read occurs, use getFilePointer as it
      // Returns the position from the beginning of the file, in bytes, at which
      // the next read or write occurs.
      start = in.getFilePointer();
      // Sets the file-pointer, measured from the beginning of this file,
      // at which the next read or write occurs
      in.seek(RECORD_SIZE);
      //a = readData(in); //read in the data for that one record
      for(int i = 0; i<36;i++){
         c = in.readChar();
         a.append(c);
      pw.println( "start >" + start ); //write out the contents of variable n
      pw.println("a >" + a);
      //close both input & output streams
          in.close();
          pw.close();
     }//end of static main
}//end of class Find6same

This is what i would like to do:
(i would prefer to stay away from a file size of 17 bytes bcz im
mentally challenged), i would like to work with something i recognize...
data file in:
0001 06/12/1982 01 02 03 04 05 06 07
0002 06/12/1982 02 03 04 05 06 07 43
0003 06/12/1982 03 10 12 21 14 41 43
0004 06/12/1982 04 11 16 22 14 41 43
0005 06/12/1982 05 12 17 23 14 41 43
0006 06/12/1982 06 13 18 24 14 41 43
0007 06/12/1982 09 10 11 12 13 14 43
0008 06/12/1982 08 09 10 11 12 13 14
0009 06/12/1982 09 10 11 12 13 14 15
import java.io.*;
public class Find6same4
   public static void main( String args[]) throws IOException
     long start = 0L;   // this holds the last postion held b4 read was called
     int moveAhead = 0; // this moves the read operation ahead by 36 bytes
     int foundOne = 0; //counts how many numbers the 2 arrays have in common
     int recordsProcessed = 1;//counts how many records have been processed, total of 10 recs in file
      //create the pw stream for output
      File outputFile = new File("C:\\jLotto\\dataFile\\find6.txt");
      PrintWriter pw = new PrintWriter( new FileWriter( outputFile ));
      //create the random access stream for reading & processing
     RandomAccessFile raf = new RandomAccessFile("C:\\jLotto\\dataFile\\numberOfBytesIn.txt","r");
      // get the record that you will compare all other
      // records against & put in "hold" array
while (recordsProcessed <11){
      String[] hold = new String[36]; //store as characters
      hold = raf.readFully;  //read first 36 chars into hold array
      // locates where your next "hold" is that you have to read
      // in & compare all other records against
      start = raf.getFilePointer();
      //loop thru remaining records until EOF, to see if 6 numbers are the same in both arrays
      while (raf.seek != EOF){
          recordsProcessed++;
          raf.seek(moveAhead);// Sets the file-pointer at which the next read or write occurs
          String[] nxtRecord = new String[36]; //store as characters
          compareArray = raf.readFully;  //read first 36 chars into comparing array
          // now compare hold[] & nxtRecord[]
          // compare characters held at the following index positions> 17, 20, 23, 26, 29, 32, 35
          for (int i=17; i<38; i=3+i){
              for (int x = 17; x<38; x=x+3){
                  if (Integer.parseInt( hold[i] )= Integer.parseInt(nxtRecord[x]) )
                  foundOne++;
              }//endof for x
              if (foundOne > 5)// if the 2 arrays have 6 numbers in common
                  printToFile(nxtRecord);
              foundOne = 0;
           }//endof for I
       moveAhead= start+36;//the next "hold" record to be read in is at this position
}//end of recordsProcessed
public void printToFile( thisLine ){
  pw.println( thisLine );
  pw.append( "/n" );
//end of find6samehere are my errors
C:\jLotto\modules\FindNums\Find6same4.java:53: illegal start of expression
public void printToFile( thisLine ){
^
C:\jLotto\modules\FindNums\Find6same4.java:56: ';' expected
^
C:\jLotto\modules\FindNums\Find6same4.java:24: cannot resolve symbol
symbol : variable readFully
location: class java.io.RandomAccessFile
hold = raf.readFully; //read first 36 chars into hold array
^
C:\jLotto\modules\FindNums\Find6same4.java:31: cannot resolve symbol
symbol : variable seek
location: class java.io.RandomAccessFile
while (raf.seek != EOF){
^
C:\jLotto\modules\FindNums\Find6same4.java:31: cannot resolve symbolsymbol : variable EOF
location: class Find6same4
while (raf.seek != EOF){
^
C:\jLotto\modules\FindNums\Find6same4.java:35: cannot resolve symbol
symbol : variable compareArray
location: class Find6same4
compareArray = raf.readFully; //read first 36 chars into comparing array
^
C:\jLotto\modules\FindNums\Find6same4.java:35: cannot resolve symbol
symbol : variable readFully
location: class java.io.RandomAccessFile
compareArray = raf.readFully; //read first 36 chars into comparing array
^
C:\jLotto\modules\FindNums\Find6same4.java:41: unexpected type
required: variable
found : value
if (Integer.parseInt( hold[i] )= Integer.parseInt(nxtRecord[x]) )
^
C:\jLotto\modules\FindNums\Find6same4.java:45: cannot resolve symbol
symbol : method printToFile (java.lang.String[])
location: class Find6same4
printToFile(nxtRecord);
^
C:\jLotto\modules\FindNums\Find6same4.java:49: possible loss of precision
found : long
required: int
moveAhead= start+36;//the next "hold" record to be read in is at this position
^
10 errors

Similar Messages

  • Open hub - output structure enhancement - will delta need to disturb ?

    Hi,
    We have done some changes to the Open hub output structure and added few output fields, now we need to move it to production. I can see in production it is delta enabled i.e. only newly added data is written in output file.
    Now, I need to move new structure to the Production, I wanted to know shall I need to distrube the delta management for Open hub output, ot it will taken care automatically.
    Kindly advice.

    Thanks,
    Which is the best ABAP function to extract an SAP table to a flat file??
    Because at this point, I have put in <b>IF_EX_OPENHUB_TRANSFORM~TRANSFORM</b>
    the following:
    method IF_EX_OPENHUB_TRANSFORM~TRANSFORM.
    data: l_s_data_in type /BIC/CYZEPC_OH_EPCOT_PROSPER,
          l_s_data_out type ZEPC_I_EPCOT_PROSPER.
      data l_dummy.
      message i899(rsbo) with 'exit started' into l_dummy.
      i_r_log->add_sy_message( ).
      clear e_t_data_out.
      loop at i_t_data_in into l_s_data_in.
        move: l_s_data_in-/BIC/ZEPCC0018 to l_s_data_out-MARQUEFIL,
              l_s_data_in-/BIC/ZEPCC0005 to l_s_data_out-GENRE,
              l_s_data_in-CALMONTH       to l_s_data_out-MOISFERME,
              l_s_data_in-/BIC/ZEPCC0008 to l_s_data_out-TYPPROSPER,
              l_s_data_in-CALYEAR        to l_s_data_out-ANNEE,
              'ABC'                 to l_s_data_out-COD_MVT.
        insert l_s_data_out into table e_t_data_out.
      endloop.
      message i899(rsbo) with 'exit finished' into l_dummy.
      i_r_log->add_sy_message( ).
    endmethod.
    So now my <u>destination DB ta</u>ble, <b>/BIC/OHZEPC_OH_E</b> (same as structure <b>ZEPC_I_EPCOT_PROSPER</b> above) should have the data inside. 
    Can I now just insert a fuction at the end to download the table to flat file???
    Thanks,
    Tim

  • How can i use my ipad3 as a complite navigation system(greek lang) without need wifi or 4g engaged?

    How can i use my ipad3 as a complite navigation system(greek lang) without need wifi or 4g engaged?

    With the wifi-only model, yes you will need an external GPS with it. A few have been mentioned on here in the past but I can't remember the names of them - you could try either searching here for them, or just do a search on the internet for iPad compatible GPS devices (I'm not sure how many work with it).

  • I have installed Itunes on my laptop. However, the apple store opens in German language. I need it in English. How can i change the language for istore through the itunes?

    I have installed Itunes on my laptop. However, the apple store opens in German language. I need it in English. How can i change the language for istore through the itunes?

    Go to the bottom of the page, click the flag, then select your country.

  • I have CS6 in Dutch, but I need it in English. How can I swap?

    I have CS6 in Dutch, but I need it in English. How can I swap?

    http://helpx.adobe.com/x-productkb/policy-pricing/order-product-platform-language-swap.htm l

  • Need to choose english instead of spanish to download adobe pro xl

    I want to download adobe pro xl but it is linked in the spanish/mac version when i need english mac how do i switch from spanish to english before I download?  need to choose english instead of spanish to download adobe pro xl

    Hi gregk31221321,
    You can try the direct download link for Adobe Acrobat Pro XI  Download Acrobat products | Standard, Pro | DC, XI, X
    Once you will serialize the Acrobat Pro XI using your Adobe ID or Serial number you will get both the languages (Spanish as well as English by default).
    You can choose to work with any of them.
    If you still experience any issue, please let us know. We will be more than happy to assist you.
    Regards,
    Aadesh

  • HI i am user for InDesincc TrialVersion now. i have serious question for all guys in here. at first i installed Indesigncc as korean language but now i need to indesigncc english language installation. and then now i cant translate and changing korean lan

    Daniel SterchiHI i am user for InDesincc TrialVersion now. i have serious question for all guys in here. at first i installed Indesigncc as korean language but now i need to indesigncc english language installation. and then now i cant translate and changing korean language interface to english language interface at indesigncc download. so i wonder How i can do that?...i am very seriuos for now....i want indesigncc version for Eng.Language interface. but now i cant do that .i dont konw how i can presented kor. interfacing transite to eng. interface..
    forumnotifierHI i am user for InDesincc TrialVersion now. i have serious question for all guys in here. at first i installed Indesigncc as korean language but now i need to indesigncc english language installation. and then now i cant translate and changing korean language interface to english language interface at indesigncc download. so i wonder How i can do that?...i am very seriuos for now....i want indesigncc version for Eng.Language interface. but now i cant do that .i dont konw how i can presented kor. interfacing transite to eng. interface..

    First of all, uninstall it with the uninstaller.
    Then:
    Install the ENGLISH version.
    Change the language in the CC app to Korean.
    Install the Korean version. (DON't uninstall the English version)
    Change back the langauge in the CC app to English.
    When your OS is running in English, InDesign will run in English with Korean functionality added, if your OS is running in Korean it will take the Korean User Interface, so let your OS run in English.
    Every installer language will add needed plugins for the work with that language. E.g. If I install Hebrew, I get RTL functionality in German version, only if I would change the OS language it would change the language of InDesign, InDesign takes always as UI language the language of the OS if available, if not (in your case you have uninstalled English before), it takes any version which is available in the order of languages specified in the OS.
    If you need to run your program in a different language than the OS but you have installed it in the language of the OS it becomes more difficult. You would have to use some system tools which are able to force a program to open with a different language. Most of those tools are freeware.

  • By mistake i have downloaded dreamweaver cs5.5 in other language.  I need it in english language. HE

    by mistake i have downloaded dreamweaver cs5.5 in other language.  I need it in english language. HELP ME

    Hi Sachin00007,
    Please contact Adobe Support and request for a cross language swap(if not purchased from Adobe directly). If purchased from Adobe then the best option would to be to return and reorder the correct product. Refer to http://helpx.adobe.com/x-productkb/policy-pricing/order-product-platform-language-swap.htm l for more details.
    Thanks
    Nikhil

  • How much space on my disk do I need to download English Adobe Photoshop Element 10?

    How much space on my disk do I need to download English Adobe Photoshop Element 10?

    Which operating system are you using?  The file sizes are different depending on your OS.  In general though if you got 10 to 15 gigabytes of disk space you should be more than fine.  If you are under 10 gigabytes it might be a good idea to do some spring cleaning on your computer to start freeing up some space.

  • I try to upgrade my ipod but it goes to Hebrew and I need it in english

    i try to upgrade my ipod but it goes to Hebrew and I need it in english

    If you accidentally change the language on your iPod - Apple Support

  • I rented a movie on apple tv not knowing it was french, i need it in english now

    So I rented a movie on apple tv not knowing it was in french because it was no where to be told. I need it in english, what do I do ?

    Rented it on your Apple tv?
    If you download a rented movie on your iPhone 4 or later, iPad, iPod touch (4th generation or later), or Apple TV: It is not transferable to any other device or computer."
    http://support.apple.com/kb/HT1657

  • My firefox page is in spainish. I need it in english

    My firefox is in Spanish. I need it in English
    == This happened ==
    Every time Firefox opened
    == when I downloaded your browser

    The browser that was used to post here was an English language version.
    Mozilla/5.0 (Windows; U; Windows NT 6.1; '''en-US'''; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3 (.NET CLR 3.5.30729)
    See if this helps you.
    http://www.google.com/support/bin/answer.py?answer=873

  • I live in China and keep having iTunes installed in Chinese but I need it in English.  How do I install it in English?

    I live in China and keep having iTunes installed in Chinese but I need it in English.  How do I install it in English?

    When you open iTunes, follow these steps: Edit
                                                                       -Prefrences
                                                                               -Under General find Language
    Hope that solved your problem

  • While multi-camera monitor is open video output looks strobed

    While the multi-camera monitor is opne the video output to my DV deck looks strobed and soft.  Any ideas?  I have CS 6 with a Sony DV deck on a MacPro 5,1.  When I close the multicamera monitor the video on the output monitor becomes sharp again.  This is simply unnacceptable as I need to see the video in full rez while playing back.

    The multicamera monitor has always had an "adaptive resolution" when it comes to playback, meaning the resolution would degrade if it needed to (based on your system's capabilities) in order to keep up real time playback, which is more critical for multicam editing than full res playback.

  • Input & output looks awful...

    Purchased the Photoshop Elements/Premiere Elements bundle last night, but I'm having an issue on the Premiere side.
    Video clips (AVI, MPG, MOV, even VOB) that normally look great when played inside Windows Media Player or QuickTime look awful when brought into Premiere Elements for editing, and look just as bad however the file is output, whether to the PC or to DVD. The video is of much lower visible quality and is quite blocky.
    Is there a setting that needs to be enabled that I'm missing?

    Read Bill Hunt on a file type as WRAPPER http://forums.adobe.com/thread/440037?tstart=0
    What is a CODEC... a Primer http://forums.adobe.com/thread/546811?tstart=0
    What CODEC is INSIDE that file? http://forums.adobe.com/thread/440037?tstart=0
    Read Harm on drive setup http://forums.adobe.com/thread/662972?tstart=0
    - click the embedded picture in Harm's message to enlarge to reading size
    - you need AT LEAST 2 drives for video editing, 3 is better
    - some HD formats work better with (require) RAID
    Read Hunt on Partitions http://forums.adobe.com/thread/650708?tstart=0
    A link with many ideas about computer setup http://forums.adobe.com/thread/436215?tstart=0
    Read Bill Hunt on editing a VOB/MPG file http://forums.adobe.com/thread/464549?tstart=0
    Tools to Convert to DV-AVI http://forums.adobe.com/thread/415317?tstart=0
    Convert http://premierepro.wikia.com/wiki/FAQ:How_do_I_convert_my_files%3F
    Convert your files to DV-AVI Type II with 48KHz 16-bit Audio
    I have NOT used the products below, I only forward due to other mentions
    $99 http://www.corel.com/servlet/Satellite/us/en/Product/1175714228541#tabview=tab0
    $99 http://www.womble.com/products/mvw.html
    $90 http://www.magix.com/us/movie-edit-pro/ plus $5 Ship
    $80 http://www.nchsoftware.com/prism/index.html
    $75 http://www.videoredo.com/en/index.htm
    $70 http://www.nchsoftware.com/prism/index.html Converter
    $40 http://www.daniusoft.com/dvd-ripper.html#135
    $40 http://www.deskshare.com/dmc.aspx Digital Media Converter
    $20 http://www.topsoftwareol.com/product/Video/Video_Converter_Standard.html
    $00 http://www.dvddecrypter.org.uk/ or http://www.mrbass.org/dvdrip/
    $00 http://www.squared5.com/ MPEG Streamclip Converter
    $00 http://www.erightsoft.com/SUPER.html Multi-Converter <-- supposed to be very good
    $00 http://www.virtualdub.org/ Mpeg to AVI Converter

Maybe you are looking for

  • IPod Wi-Fi broken, will no longer connect, network details all blank

    Hello, My iPod has been working fine with Wi-Fi for ages. But today I got home and it's no longer working. At all. To any network. I clicked on the blue arrow next to my home network and IP Address, Subnet Mask, Router, DNS, Search Domains and Client

  • How to remove a SFSB in web page??

    Hi all, I have a question on when should I call remove() when ejb is involved in web pages. I have searched the past threads in this forum and someone suggested to use http binding interface. It is really a great idea. However, I still have two quest

  • Default program(really confused)

    so now i have a notepad like program, it is a executable jar.. now, i want all the txt file associated with my program, the problem is, i cant change the file association to my program, lets say javanotepad.jar caus it is a jar file.. can any one hel

  • Breeze Presenter Fehler?

    Hallo miteinander, leider ist das Breeze Forum nicht erreichbar, daher poste ich meine Nachricht mal bei euch. Ich habe mir soeben den Presenter 6 runtergeladen. Im Handbuch sowie im Quick Guide wird jedes mal die Möglichkeit aufgeführt, dass man die

  • Can't view documents Mac OS 10

    The file appears to open but no text is visible. There are no error windows. Adobe Reader 9.5.5