Scanner Question

Hey folks, I'm new to programming, and new to this forum. I'm working on a project for school, and I'm stuck.
I'm trying to read from a txt file line by line with the Scanner class, I want the scanner to ignore any blank lines in the file. The lines must be blank, no spaces, just carriage(sp?) returns.
Thanks all.

Just check the String the Scanner returns for its length() > 0 ?

Similar Messages

  • I bought a Canon 8400F scanner- question about multiple photos being scanne

    Hi,
    I have a question about about scanning photos. It was posted that if you scan something with multiple photos, it will separate the pictures.
    If I put 6 pictures on the scanner, will it automatically scan them and separate them, or is there something in the software where I select it to separate each picture.
    Thank you

    I'm not at my Mac right now but it should be real obvious in the CanoScan software. Open it up and play around. It will jump out at you.
    You don't tell it to select "each" picture. You merely tell it that there are multiple pictures and it then does everything automatically.

  • Importing from a scanner question.

    Hopefully this is a easy, but I can not file the answer to this. Is their a way to change the default file format when scanning to Photoshop CS5. It defaults to a BMP file I want it to a Jpeg file format?
    Thanks for the help.

    I'm sure this might also depend on the scanner's interface but why would you want to load a lossy format directly into Photoshop to once again save in a lossy format? You'd do better to import as the uncompressed BMP and then do a JPG save from Photoshop. You might also use the scanner software directly and scan to JPG instead of bothering with the overhead of Photoshop.

  • Adesso Nuscan 2100 Barcode Scanner Questions

    I just bought an Adesso Nuscan 2100U (USB) Barcode Scanner and I'm having trouble getting the computer to see it. When I first plug it in to a USB port, I get the "new or unrecognized keyboard" popup window, and it begins the setup process. Problem is, since it's not really a keyboard, I can't complete the setup, and I think my Mac then simply ignores the scanner. By saying ignore I mean I open a program like TextEdit, scan a known good barcode with the gun, and nothing appears on the screen.
    Has anybody used a scanner like this, and if so, how did you get the computer to recognize it and work properly? Adesso and the packaging for the product all say it's Mac compatible, but there are no setup instructions anywhere that I could find. So, I'm stuck.
    I'm using a PowerMac G5 with Tiger 10.4.11, and I'm plugging the scanner into the front USB port which works just fine for all other USB devices I've got. My eventual use for this scanner is to scan information into FileMaker Pro databases. I've also tried it under 10.5 Leopard, and on a Windows PC. I can't get any text on the screen (in any app) after I scan a bar code.
    Thanks for your help!
    Jeff

    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.

  • Epson v700 scanner question

    I am trying to install my Epson v700 scanner on my new Mac Book Pro OS 10.8.3. Buty I cannot open the application because I get a message " Power PC applications are no longer suypported". What do I do?

    Go to the Epson site and download the drivers for OS X from there
    Allan

  • Virus scanner question

    To those readers who are established Apple users, do you choose to have a virus scanner and a software firewall on your computer?
    I know the virus threat to OS X are not comparable with the threat to Windows PCs but I'd be curious to know your thoughts on the subject.

    What about users running Windows on their new Macs through a virtualization program such as Parallels?
    If you are using Boot Camp or Parallels then you are at risk just like any other PC. So, in this case I would STRONGLY recommend anti-virus software just like with any other PC. Additionally, an anti-malware product wouldn't go astray either.
    With VPC, you can supposedly protect the PC through the Mac firewall by disabling the "virtual switch networking" feature.
    The firewall does not protect you from viruses but from external intrusions. While they both are risks to your computer they are distinctly different things.
    Does anybody know how Parallels works, security-wise?
    Parallels is just like any other PC when it comes to the security of the OS you install under it. Although, it does insulate your Mac OS X installation from any damage providing you do not share files and folders with your Mac OS X data.

  • Simple scanner question

    How could I grab whole sentences into a String with scanner class?
    For example:
    if I'd do a structure like this
    Scanner sc = new Scanner(System.in);
    String [] h = "";
    h = sc.next();
    and I'd input something like "i like watercrackers with cheese "
    String h would only be "i".
    How could I get it to grab the whole sentence or at least dump everything into a String array?

    Would this be right - I did not use a while or for loop but it works. I did not use hasNextLine either. Strange.
    import java.util.*;
    import java.io.*;
    public class EndOfFile
         public static void main(String[] argStrings) throws Exception
              String contents = null;
              String fileName = argStrings[0];
              Scanner scanner = new Scanner(new File(fileName));
              System.out.println("Contents of that file: ");
              System.out.println();
              do
                   contents = (scanner.nextLine());
                   System.out.println(contents);
              while((scanner.hasNext()));
    }

  • Quick scanner question !

    scanner = new Scanner(file + a + txt);
                StringBuilder sb = new StringBuilder();
                while (scanner.hasNextLine()) {
                    sb.append(scanner.next());
                          System.out.println(sb.toString());I am doing this to read the input from a text file, but it doesnt want to be read correct.
    I made it work like 2 hours ago, but a stupid Windows crash lost all my data.... and this piece is puzzling me .
    i remember i had to add one more line something like
    sb.append(System.properties(" " );
    but nothing makes me read the whole document
    Some help would be crucial here !

    file = A sting "log"
    a = A string that is sent, a time stamp
    txt = ".txt"
    so it will create the text log1345.txt
    the log is correct , as below i can write into it.
    and that i how it was used some time ago :(
    The nextLine() as well was also used but still after a space it would just stop reading .....

  • HP Officejet Pro 8600 Scanner Question

    As title states, I have a 8600... I scan hundreds of documents a day into PDF format.   Right now the only way I see doing this is by placing an individual sheet in the scanners top tray then scanning it using the screen...  What I want to do is put say 10 to 20 sheets in the tray at time, then scan.. but have each sheet become it's own PDF.. .not one long PDF with 10 to 20 pages...
    Is this possible with this scanner?
    Thank  you,

    Welcome to the forums JMartinfb
    I understand you are looking to complete a multiple page scan and have each page save as an individual file on it's own. This is an option you can change within the printer software in the advanced options.
    Click the link, select your OS, Scan with HP Software and How to scan multiple pages into a single file.
    I hope that helps, have a great day
    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!

  • CS photoshop suddenly won't open after 5 years

    CS photoshop suddenly won't open after running perfectly for 5 years. I do not have the original install disc.
    Any suggestions? Apple and Adobe Tech folks could not help.

    Cris (and Tai Lao)
    there was no installation of a scanner (my Canon LiDe 500F scanner 
    has worked just fine for years) or camera driver (altho I had 
    recently downloaded some pix from my nikon onto iphoto) BUT— your 
    idea was brilliant!--disable Twain, which I did and ps launched 
    successfully!!
    Now, as Tai Loa predicted, I can no longer import the scanner thru 
    ps. Given my current work crunch that's not so terrible, but how does 
    one access a scanner without using ps? If you have had just about 
    enough of me and want to pass on that question I'll understand.
      I am ever so grateful to the two of you for making my ps usable 
    again, but it's midnight here in NYC and I have to pack up my tent 
    and  look for your scanner question reply at the crack of dawn 
    tomorrow. It's been an exhausting anxiety-ridden day but I'm relieved 
    and grateful that there are bright people like both of you out there, 
    interested and willing to help. Many thanks.

  • Upgrading to Elements 8

    At the moment I am using Elements 6 and I am going to upgrade to 8. What I am wondering is will I have to uninstall Elements 6 first or will Elements 8 install over the top of Elements 6. Thanks.

    Good morning Mr Misery
    A couple of weeks ago I upgraded to PSE 8, no problems at all.  It was especially useful to be able to 'convert' my PSE 6 catalogs to PSE 8, which was a seemless task.
    However, I may be able to save you some aggravation with this simple advice, "If after installing PSE 8, you find a task you used to run in the Organiser doesn't work, try to run it in the Full Edit mode.  I have spent hours of frustration before someone mentioned to me as a , 'Oh by the way' suggestion."
    After posting this, I shall be asking a scanner question which may be of interest to you
    Good luck, in spite of some teething problems, so far I have been happy with PSE 8
    Tribune21 

  • Two questions: Scanner and exception handlers

    Extreme Newbie Alert: I took a single college semester involving Java, almost five years ago, and haven't really touched it since until recently when I decided to try to get back into it. I am now working on building a program while reading the Java 5.0 Tutorial downloadable from Sun.
    Okay, now that the faint of heart have left us, here are the two questions I want to ask:
    1) I am trying to use the Scanner tool ( http://java.sun.com/j2se/1.5.0/docs/api/java/util/Scanner.html ) on a FileReader wrapped in a BufferedReader. I have installed JDK 5.0 and I am importing java.util.*, but when I try to compile I get this error:
    Wishlist.java:71: cannot resolve symbol
    symbol : class Scanner
    location: class Wishlist
    Scanner readFromMe = new Scanner(new BufferedReader(new FileReader("wishlist.txt")));
    ^
    ...and then another one pointing to the other appearance of "Scanner" in the same line, followed by six more in places where I use the readFromMe variable that line was supposed to declare and initialize. Any idea why the compiler doesn't recognize Scanner even though I'm importing its package?
    2) Is there anything preventing you from nesting exception handlers? As you've seen, in this program I open a file...if that attempt produces a FileNotFoundException, I want the error handling to create a new, empty file to use in place of the one that should have been there. Since this could throw an IOException of its own, I would need to put a try | catch block into the other catch block. Is the compiler going to stand for that? Alternatively, is there any input stream that creates a file with the specified filename if there is none already? Probably not, since a newly created file will be empty and there's no point in having an input stream on it...

    1) Are you sure you installed and are invoking jdk
    1.5? Maybe you have an earlier version ahead of it
    on your path.Hm. I did use 1.3 back in college...I checked the contents of PATH and the User Variables version of it was set correctly but the System Variables version of it was set to 1.3. I corrected the System Variables version of it and now the compiler doesn't complain about Scanner...but I'm still getting errors that it doesn't recognize readFromMe even after I initialized it. Odd...
    2) yeah you can nest try/catch blocks like that.
    However, in this case, exceptions sound like the
    wrong way to go. A missing file sounds like a real,
    regular possibility -- it's not that exceptional as
    you describe it. A better thing would be to create
    a File object, see if the file exists, and then if
    it doesn't go ahead and immediately handle that
    case. Don't even try to open the file that may not
    exist.Okay, I'll try rewriting the file read like that, and hopefully the readFromMe errors will go away. If they don't I'll make a new post...probably with the entirety of the code because I can't even guess at what part of the code is causing that. Thanks for the help!

  • Aperture with Scanner and other related questions

    One month ago I've purchased an iMac 24", and I'm planning to buy Aperture.
    If some one can help me, I have these Questions:
    1.- Can I scann from Aperture importing from my Scanner Epson Perfection 3170 and put the pics on the Aperture Gallery?
    2.- Which file format TIFF, DNG?
    3.- Why use VAULT if I have an external HD and I use Time Machine
    4.- It make sense use Photoshop Elements if I buy Aperture?
    5.- Can I import on Aperture the keywords I've created on BRIDGE?
    Thank you
    Best regards
    Luis

    Hi. Point three the vault backup is aperture just being safe, yes the time machine is great and will work trust me. If god forbid there is a small fire from a power pack etc you can loose the pc and backup drive this is the point of the vault make another backup keep the drive at work for safety simple. The vault is great for making incremental backup very fast. Point 4 elements works a treat with aperture you can set it as external editor if you need too, the pair complement each other and the best thing elements is cheep now.

  • How to get CS6 to open Epson 3170 scanner in professional mode? [was:question]

    I use an Epson 3170 scanner how do i get cs6 to open it in professional mode?

    I recommend that you check on epson's website and see if there is forum that you could ask that question on. As that is very specific question toward epson and requires someone who owns that brand to help you.
    Also let them know what version of photoshop you have and what OS you are using, as drivers are specific to each OS.

  • N6350 Scanner Setup question

    The desired setup is to have four stand-alone scanners that allow the users to walk up,  stick some pages in the feed, push a button, and the document gets scanned to a network share.  I have a virtual server set up with the management software so I can see the scanners.
    How do I set the scanners to have the walkup functionality?

    Hi OtakuLord,
    I suspect your question would be better answered in the HP Enterprise Business Community,  as the HP ScanJet N6350 is a commercial model.
    My technical expertise is with consumer products and software, I am sure the commercial folks would be happy to help if you re-post your question for them to answer. The HP Enterprise Business Community is an HP Forum designed for the Commercial and Enterprise customers to help one another. I am sure you will find some HP folks there to help too.
    Click here to view the Scanners Boards  When the page opens you will see the option to 'Log in' or 'Register Now' on the right. The commercial forums are separate from the consumer boards, thus you will need to register if you don't already have a commercial account.
    You may find the HP Scanjet N6350 Networked Document Flatbed Scanner support page helpful while you wait for somebody in the commercial Forum to respond to your inquiry.
    Best of luck.
    Please click the Thumbs up icon below to thank me for responding.
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    Please click “Accept as Solution” if you feel my post solved your issue, it will help others find the solution.
    Sunshyn2005 - I work on behalf of HP

Maybe you are looking for

  • Help needed with notes in iCloud

    I have lost all the notes on my iphone but they are still on my Mac and ipad. When i enter a new note they only sync between ipad and mac and not my phone, I have signed into icloud online and they appear there if I enter them from ipad or mac but no

  • Re: BT can actually fix broadband faults! (no I'm ...

    Can anyone tell me how I get in touch with this chariman's office? It's been years and I have tried writing to the 'managing director' but not had a response. My next step i think in any case is the only one open to me: sending a bill for compensatio

  • Apple TV - Startup Assistance

    I just ordered Apple TV having just recently crossed over from the darkside (pc's).  Is there a site on how to setup and use Apple TV with all Mac devices.  Thank you.

  • Disk cannot be read...

    When I try to download music to my nano an error message comes up that says disk cannot be read from or written to. what does that mean? Also says it can not be updated?

  • App Folders in Configurator

    I'm using Configurator to control 30 iPads at my school, I can backup a master and push to all but can't use the 'Supervise' function. Each time I try to supervise all the folders disappear and I'm left with a mess of apps. I have also checked all th