scanner

get entire line with java.util.scanner.hasNext(regex)

I'm doing something in Java that requires input to be matched against the pattern ^[1-5]$. I should have a while loop looping through each line of input, checking it against the pattern, and outputting an error message if it does not. Sudo code: while (regex_match(/^[^1-5]$/,inputLine)) { print ("Please enter a number betwee...

Java Scanner won't follow file

Trying to tail / parse some log files. Entries start with a date then can span many lines. This works, but does not ever see new entries to file. File inputFile = new File("C:/test.txt"); InputStream is = new FileInputStream(inputFile); InputStream bis = new BufferedInputStream(is); //bis.skip(inputFile.length()); Scanner src = new Sca...

Is there a receipt scanner with a .net api I can use to integrate into my app?

I need to find a receipt scanner (Similar to the Neat Receipts scanner) that can be portable and that has an API which I can integrate into my app. I also need a PEN barcode scanner with a modifiable API. IF you know of any one of these items, I would sure appreciate some feedback. ...

How to improve HBase Scanner??

Ho do I configure HBase so that the scanner only retrieves a number of records at a time? Or how do I improve the scanner when the database contains a lot of records/ ...

C#: How to avoid WIA-error when scanning documents with 2400dpi or more?

Hello, when we scan a document with a resolution of 2400dpi or higher, we recieve (for example) the following error-message: COMException: Ausnahme von HRESULT: 0x80010100 (RPC_E_SYS_CALL_FAILED) or COMException: Ausnahme von HRESULT: 0x8021006F in one of the following lines img = itm.Transfer(scanFormat.ScanFormat) as ...

How do I detect server status in a port scanner java implementation

I am writing a port scanner in Java and I want to be able to distinct the following 4 use cases: port is open port is open and server banner was read port is closed server is not live I have the following code: InetAddress address = InetAddress.getByName("google.com"); int[] ports = new int[]{21, 22, 23, 80, 443}; for (i...

How to edit a .txt file in Java

i think i can use "Scanner" to read a .txt file but how can i write or even create a new text file? ...

filling array gradually with data from user

I'm trying to fill an array with words inputted by user. Each word must be one letter longer than previous and one letter shorter than next one. Their length is equal to table row index, counting from 2. Words will finally create a one sided pyramid, like : A AB ABC ABCD Scanner sc = new Scanner(System.in); System.out.println("Give the ...

Java Scanner newline parsing with regex (Bug?)

I'm developing a syntax analyzer by hand in Java, and I'd like to use regex's to parse the various token types. The problem is that I'd also like to be able to accurately report the current line number, if the input doesn't conform to the syntax. Long story short, I've run into a problem when I try to actually match a newline with the S...

How to use scanner in c#.net application

Hi All, I have a barcode scanner(Symbol-ls2208) but i dont know how to read information from it to my application (in C#). Can anyone help me in this problem with sample code? Os: Windows XP. scanner: Symbol LS2208 General Purpose Bar Code Scanner Geetha. ...

Scanner cuts off my String after about 2400 characters

I've got some very basic code like while (scan.hasNextLine()) { String temp = scan.nextLine(); System.out.println(temp); } where scan is a Scanner over a file. However, on one particular line, which is about 6k chars long, temp cuts out after something like 2470 characters. There's nothing special about when it cuts out; it's...

USB interface barcode scanners

Not exactly a programming question, but close. I'll try my luck anyway. The keyboard wedge barcode scanner inserts the translation device between the reader and the keyboard. Data sent through a wedge appears as if it was typed into the computer, while the keyboard itself remains fully functional. Because a computer usi...

How to use Scanner to read silently from STDIN in Java?

Hi, Is it possible to use the Java Scanner to read from STDIN silently? I mean, without outputting any pressed chars to the terminal? ...

How to use Scanner to accept only valid int as input

I'm trying to make a small program more robust and I need some help with that. Scanner kb = new Scanner(System.in); int num1; int num2 = 0; System.out.print("Enter number 1: "); num1 = kb.nextInt(); while(num2<num1) { System.out.print("Enter number 2: "); num2 = kb.nextInt(); } Number 2 has to be greater than number 1 Also I want the...

Parse Text using scanner useDelimiter

Looking to parse the following text file: Sample text file: <2008-10-07>text entered by user<Ted Parlor><2008-11-26>additional text entered by user<Ted Parlor> I would like to parse the above text so that I can have three variables: v1 = 2008-10-07 v2 = text entered by user v3 = Ted Parlor v1 = 2008-11-26 v2 = additional text entered...

Testing WIA without having a scanner/camera device

Hello, I wrote a simple scanning code using WIA. I don't have a scanner device so I can't test it. Can I simulate a WIA device to testing it ? ...

Java: CSV file read & write.

Im reading in 2 csv file: store_inventory & new_acquisitions... I want to be able to compare the store_inventory csv file with new_acquisitions. 1) If the item names match just update the quantity in store_inventory. 2) If new_acquisitions has a new item that does not exist in store_inventory, then add it to the store_inventory. Heres ...

Java Scanner class reading strings

I've created a scanner class to read through the text file and get the value what I'm after. Let's assume that I have a text file contains. List of people: length 3 1 : Fnjiei : ID 7868860 : Age 18 2 : Oipuiieerb : ID 334134 : Age 39 3 : Enekaree : ID 6106274 : Age 31 I'm trying to get a name and id...

Add my custom made scanner capturing software to the list of Events in the Scanners properties

I developed a custom made (.EXE) application to scan document using TWAIN and would like this software to be part of the list of scanners that appear in the Events tab within the Scanners properties window. does anyone have an idea how this can be achieved? ...

Validating input using java.util.Scanner

I'm taking user input from System.in using a java.util.Scanner. I need to validate the input for things like: It must be a non-negative number It must be an alphabetical letter ... etc What's the best way to do this? ...