Scanner is not reading properly.

Hi,
I am using Java Scanner to read-in some numbers from a file.
It is skipping some of the inputs randomly and is not reading sequentially..
What may be the issue here?

Hi,
I am pasting my scanner code below,
           File template = null;
            FileReader read = null;
            BufferedReader buffRead = null;
        Scanner scan = null;
        try
            template = new File(templateFile);
            read = new FileReader(template);
            buffRead = new BufferedReader(read);
            String[] values = null;
            String line = buffRead.readLine();//discard the first line
             scan = new Scanner(buffRead);
               JLE = scan.next();
                JTE = scan.next();
                NOSECT = scan.next();
                KIN = scan.next();
            scan.close();
            buffRead.close();Here is my input file data,
Some title here
28 73 28 11 5000 14 52 12 28 0 24 1250 0
1 11 3 3 2 1 0 9 10 0 1 0
3 3 3 9 9 9 1 3 1
0.00000 0.00000
0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000
0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000
0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000
0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000
0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000
0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000
0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000
In my code I am removing the first line, i.e title by using buffRead.readLine() and discarding it.
And later I start reading the actual data into some String variables.
I have found that this works sometimes.
Ideally JLE & JTE should be initialised to 28 and 73 respectively (starting numbers in input file).
But many a times JLE takes value 73 and further used variables reads into values in some random pattern.
What is the problem in my code?
regards,
Praveen
Edited by: Praveen_Kumar_Jayaram_1985 on 16/07/2008 20:25

Similar Messages

  • Scanner is not working properly

    My scanner is not working properly .It used to work properly .Recently I had just changed the Black catridges with new ones .The catridges were purchased from HP online store itself .
    I am not sure whether the issue is occuring after the catridge replacement .Whenever I am trying to scan  I am getting a completly black page with some stripes towards one end ..

    Welcome to the forums @Sangeetha123 !
    I read your post about the scanning problems you're experiencing with your Deskjet Ink Advantage 2060 when scanning to your Windows XP system, and I hope to help you!
    I want to start off pretty basic and have you make a copy from the front of the printer. Make a copy in black and white, and also a color copy. Please let me know what the results are from making those copies.
    If there is any issues with the copies, try a power reset (below instructions), and make sure the printer is plugged in directly to the wall outlet, avoiding power bars and surge protectors.
    Press the Power button to turn on the product.
    With the product turned on, disconnect the power cord from the rear of the product.
    Unplug the power cord from the wall outlet.
    Wait at least 15 seconds.
    Plug the power cord back into the wall outlet.
    Reconnect the power cord to the rear of the product.
    If the product does not turn on by itself, press the Power button to turn it on.
    I hope to hear back from you!
    R a i n b o w 7000I work on behalf of HP
    Click the “Kudos Thumbs Up" at the bottom of this post to say
    “Thanks” for helping!
    Click “Accept as Solution” if you feel my post solved your issue, it will help others find the solution!

  • After I upgraded to Mavericks my Epson 5000V scanner is not working properly.  I can scan by going into Preference/PrintersScanners to operate the scanner, but I cannot find the output.

    After I upgraded to Mavericks my Epson 5000V scanner is not working properly.  I can scan by going into Preference/PrintersScanners to operate the scanner, but I cannot find the output.  I am trying to save the scan as a PDF in Documents.

    Have you installed Apple's latest Epson drivers?
    They are here:
    http://support.apple.com/kb/DL1398

  • USB Barcode Scanner (Adesso) not reading on Mac Mini

    My friend bought an inexpensive USB bar-code scanner (Adesso Nuscan 1000U), which they said should work fine in OSX, to use on his Intel Mac Mini, running Leopard 10.5.4.
    Model Name: Mac mini
    Model Identifier: Macmini2,1
    Processor Name: Intel Core 2 Duo
    Processor Speed: 2 GHz
    Number Of Processors: 1
    Total Number Of Cores: 2
    L2 Cache: 4 MB
    Memory: 1 GB
    Bus Speed: 667 MHz
    Boot ROM Version: MM21.009A.B00
    SMC Version: 1.19f0
    Serial Number: YM7309F0YL2
    After plugging the scanner directly into his computer, it was acknowledged to be an "non-standard" keyboard...
    - the "Keyboard Setup Assistant" window popped up, and he hit continue (instead of closing the window)
    - "Identifying Your Keyboard" came up, and he had hit "z" on his main keyboard (a mistake, he knows now)
    - said scanner will not "print scanned data to screen" as it ought to
    - scanner "goes to sleep" after it scans it's first barcode - does not 'wake' until unplugged and re-plugged into Mini. Never does this on other machines.
    - scanner works perfectly on three other Macs running Leopard (same version on all four machines), both Intel and G4 based
    - I have repeatedly trashed the "com.apple.keyboardtype.plist" file in hopes of re-setting his computer to read this device properly, with no luck - but each time it's trashed and we plug in the scanner it pops up the "Keyboard Setup Assistant" window, which we simply close... like on the other test machines.
    I know it's not the scanner itself, as it works fine on all other systems with the same OS. We had simply skipped the "Identifying Your Keyboard" prompts and closed those windows and the device merrily scans barcodes and prints them to any text window - as it should.
    Is there a chance that some difference in the Mini hardware would somehow not allow this device to work properly with it? I'm completely stumped. Thanks for any assistance!!
    -ant.

    Not to be rude or contrary, but if you read my entire posting, the same unit (usb scanner) works successfully on at least three other machines with different processors running Leopard.
    To further elaborate:
    • manufacturer has been contacted and in touch - they have no idea why it doesn't work on mini
    • no software or drivers - none needed for all the other machines
    • my workaround (deleting .plist file) did nothing except prompt
    the computer to ask me what kind of keyboard device it was (none)
    Thanks for the effort... and the welcome.

  • Took a document from Apple to PC and now it will not read properly

    I recently bought a new Toshiba and updated my reader and a document I viewed for years now will not open properly. It says it is missing
    NISIZR+WhitneyCondensed-Medium
    a font that was not even on my apple and therefore will not display properly. What gives?

    Very difficult to say without seeing the actual document.

  • New Battery Not Reading Properly

    I just bought a new battery direct from Apple for my 1st generation Macbook Pro, but it's been having trouble reading the levels properly. The highest it'll say it's charged is 4 hours, but when I unplug the adapter after 1 minute it'll say 30-60 minutes was drained, then again the same thing, then sometimes it'll bounce back up to an hour, then drain back down drastically.
    I've bought a battery not long before this, but not from Apple. I've read the non original batteries not bought from Apple directly have problems like this. That one was doing the same thing, and after a month it left me with about 15-60 minutes of charge, so I had to keep it pluged into the adapter all the time. So, I figured I buy the OEM battery from Apple this time, but still the same issues. The only difference is the new OEM battery is not overheating like the last battery.

    Hi b,
    http://www.apple.com/batteries/notebooks.html
    http://support.apple.com/kb/HT1490
    Also try an SMC Reset: http://support.apple.com/kb/HT3964

  • Id2 tag not read by Music app correctly

    Dear users,
    I have a couple of tracks, for which the id2 tags are not read properly. I made sure
    - I deleted the id1 tags and use only id2 tags.
    - I checked with other Windows SW (MediaMonkey, VLC player) for tags. All are the same and correct.
    This is, what I see in VLC:
    This is, what I see on my Z10.2.2.:
    I'm awaiting  the following on two lines, an the song should be listed under the Album name (Supernature):
    Ohh la la [live]
    Goldfrapp
    How can I upload a file, so others could check for id2 tags with other BB player, please?
    Cheers,

    I'll try that !
    What bugs me is that all the various tagging programs I have tried tell me the tag are in id3v2.3...
    Anyway, I'll install iTunes again and keep you updated.
    Cheers !
    edit :
    Good call ! Thanks a lot !
    Now... When once the tags are converted, I have to move the folder containing the updated mp3s to another folder than "My music" and then move in back in so that the media sniffer, being acti've, removes the album and then re-reads the whole correctly and shows up the track numbers in my library.
    I thought the "update" option in Mediasource ("Actualiser" in my French version -mais oui !- in the menu that pops up when you right click on a track in the library window) would do the trick, apparently I'm wrong, since nothing happens tag-wise when I do it :|.
    I thought I'd just convert everything through iTunes, delete the whole library in Mediasource and create whole a new one, but if I don't ask, I'll never know : is there a way to have the Mediasniffer read the tags again ? Message Edited by Umbrifer on 08-29-2006 0:38 PMMessage Edited by Umbrifer on 08-29-2006 0:50 PM

  • Barcode is not reading using the barcode reades

    hi
    In my application i am generating barcode.But the barcode scanner is not reading this value.I am using CODE128 and also tried with code128A.
    it is urgently neede pls help me.
    will give points for helpful answers
    Warm regards
    Shanto Aloor

    Hi Shanto,
    The problem might be the width of the barcode. Try increasing the width, and the reader would recognise it.
    Regards
    Anil Madhavan

  • This is an error from my HP scanner. How can I fix the problem? An error has occurred saving the file because it could not be written to. Check the properties for the file to make sure it is not read-only.

    I recently uploaded the Maverick operating system. I wanted to scan some things on my HP Printer/Scanner and could not . This is the error message I received: An  error has occurred saving the file because it could not be written to.   Check the properties for the file to make sure it is not read-only. I am a novice with the computer and have no one to help. I hope someone knows an easy fix.
    Thank you

    This worked for me:
    "Although it is not a 'fix' for the HP issue, I did find a workaround that helped me. In the Preferences Panel in MacOS X you can pull up the Printer/Scanner preferences and scan directly from OS X. I'd not known of this prior to posting here and it worked like a charm."
    "Of course, HP should still update their software, but it's good to know that Apple has it covered for them."
    I found it here:
    http://h30434.www3.hp.com/t5/Mac-Printing-and-Scanning/MAVERICKS-WONT-SCAN-HP-C3 09A/td-p/3052105

  • Adobe Reader XI and Adobe Reader X Pro (Editable PDF Combobox Search is not working properly.)

    I have created Editable PDF using itext(5.3.0) in java. I have used Adobe Reader XI and Adobe Reader X Pro.  But in editable PDF combobox search is  not working properly.
    It's only search first character.

    My (admittedly old and slow) system did this too the first time I opened Reader 11, but it "unfroze" after about fifteen seconds, (an eternity in computing time, I know, but it did eventually open all the way) What you're seeing on the right is the "Tools" panel initializing. That's exactly where mine would freeze up on starting. Once it did finally open fully, I clicked the "Tools" link at the top to close the panel, and I opened and viewed a document that way, then closed reader. Now when I open Reader, the Tools panel doesn't initialize and it opens immediately.
    Reboot and before you open anything else, open Reader. When you open it, DO NOT try to do anything with it until it fully opens, don't click anything, don't try to switch to another app. Give it time to open fully, and then click the Tools link to close it. Then, open and view a document, and close it. Close Reader and reopen it. the Tools panel should remain closed and Reader should open fully immediately.

  • Compressed PDF file is not displaying properly in Windows 8 Reader app

    Hi,
    We have compressed a PDF file using some third party library. The compressed file is displaying properly, when we're opening the file with ADOBE reader. The same file is displaying blank, when we're opening the file with Windows 8 reader.
    Can anyone help us to solve this issue?
    Regards,
    Kamaraj P

    Hi Puneet,
    Thanks for your reply.
    I have shared the skydrive link of PDF files which are not opened properly with Windows reader.
    https://skydrive.live.com/redir?resid=2BA789F8EDB6510C!228&authkey=!ADyKA-JLOFDTqyI
    Flowers.pdf is not displaying correctly and Tiger.pdf is displaying as blank in Windows reader. But both are displaying correctly in Adobe reader.
    We have used LeadTools 14.5 library to compress the pdf files.
    Regards,
    Kamaraj P

  • [svn] 1978: Bug: vendors. properties file which is used in vendor specific login commands was not being read properly and as a result some login related error messages were not being displayed correctly .

    Revision: 1978
    Author: [email protected]
    Date: 2008-06-06 08:05:34 -0700 (Fri, 06 Jun 2008)
    Log Message:
    Bug: vendors.properties file which is used in vendor specific login commands was not being read properly and as a result some login related error messages were not being displayed correctly.
    QA: Yes - we need automated tests to make sure that errors.properties and vendors.properties in BlazeDS/LCDS are loaded properly.
    Doc: No
    Modified Paths:
    blazeds/branches/3.0.x/modules/common/src/java/flex/messaging/util/PropertyStringResource Loader.java
    blazeds/branches/3.0.x/modules/opt/src/jrun/flex/messaging/security/JRunLoginCommand.java
    blazeds/branches/3.0.x/modules/opt/src/tomcat/flex/messaging/security/TomcatLoginCommand. java

    I have a lot of grief with this version of Windows Media Player.
    It is very buggy and frustrating to use.
    I have my Music library on a QNAP NAS, which is as reliable as they come.
    System notifications make it not save changes.  It also does not do a good job of interpreting albums and artists from folders.  Changes to track names are not saved, nor are tracks moved to other albums, renamed albums, changes to genre, artist
    or date.  It separates and merges albums/tracks without sense or reason.  Some changes I've made up to 4 times, then closed WMP and re-started my machine to check if it has/hasn't saved the changes.  Often it has not.
    This is the first time I've used WMP in this capacity, and I do not recommend it.
    New service pack please.

  • Adeyemi Fawole - Adobe Reader not working properly

    Hello, this is Adeyemi Fawole. I have a query, my adobe reader is not working properly and show an error 'not supported a file'. How I sought out this problem?
    Regards
    Adeyemi Fawole

    Adobe says "Downloading", then says "Already installed", then leaves me with a faulty program!

  • Epson USB Scanner not working properly after 10.44 update

    After 10.44 update, my Epson 3490 USB Photo scanner has stopped working properly. Is this just another one of those update issues that seem to be reported at the moment. Will someone at Aplle actually fix thisat some point?

    I can't open Epson Scan - it appears in the dock and info bar for about 2 seconds, then quits. I can sometimes open SmartPanel by pushing the scan button on the unit, but then it says "Please install the supported TWAIN driver." Most of the time it appears in the dock and info ba) but doesn't open the window itself. Epson couldn't fix it. It works on a PC, so they said it's a Mac problem.

  • Opening Error: Colors could not be properly read

    After HD failure, replacement, and HD contents recovery, other iLife applications seem to function correctly, but iWeb (version 1.1.2) opens existing site with some images absent, some incorrect colors, and the following message:
    "The following errors occurred while trying to open this document: One or more colors could not be properly read, and may not display correctly on some systems."
    This is obviously true, but no further advice is provided.
    The website displays correctly as previously published on .Mac, and on a folder restored from the original HD.
    Themes display correctly in the chooser, and new pages created from the same theme that does not display correctly in the existing site, display as they should.
    I think the problem is with Domain.sites itself, therefore reinstalling iWeb will have no impact (except to replace Domain.sites with a "blank").
    Is there a way to use the published sites to recreate a correct Domain.sites file?
    PowerBook G4   Mac OS X (10.4.8)  

    No.
    What you can do however is open the original Domain site, highlight the contents of one page and copy it. Close that old Domain site, open the new Domain site - Paste the contents. Repeat until you've found the culprit file(s)

Maybe you are looking for