scanner

Scanner doesn't stop to get input.

Alright, very noob question. I'm making a CLI app that lets users design surveys. First they enter the question, then the number of choices and the choices. I'm using a Scanner to get input, and for some reason it lets the user enter most things, but not the text of the question. Code snippet below. String title = ""; Question[] questio...

Problem with java.util.Scanner & strings

Hey, I tried to implement a simple yes/no input with java.util.Scanner. My code looks like this: public boolean ask(String quest){ String answ = scann(quest + " (y/n)"); answ = answ.split("")[1].toLowerCase(); if(answ == "y") { return true; } if(answ == "n") { return false;} //if answer isnt understood printOut("Please ent...

How to start Window Mobile programme?

I am new in Window Mobile Programming. I have to make to scan Wifi networks and join to the network using Window Mobile 6.5 Professional device, CE OS 5.2. But I do not know how to start it. I am a beginner. Please give me tips to start it. What language and tool is better? Where is the helpful documents? any thing for beginner. Thanks ...

Java Scanner.useDelimiter() problem with ""

Hi all, I have having a problem with Java Scanner.useDelimiter() delimiting "". I am trying to use the Scanner to read a CSV file.The CSV have 2 column (Name, Description) and the Description field have long paragraphs (with , and .) I am wondering what delimiter for this case. ...

How can I Scan file to search for value

I need to scan an input file and search for a specific value. How do I do that? ...

reading a file using java scanner

One of the lines in a java file I'm trying to understand is as below. return new Scanner(file).useDelimiter("\\Z").next(); The file is expected to return upto "The end of the input but for the final terminator, if any" as per java.util.regex.Pattern documentation. But what happens is it returns only the first 1024 characters from the...

Output from a file in printf

Looking for help with the following code: package pkgPeople; import java.io.File; import java.io.FileOutputStream; import java.io.ObjectOutputStream; import java.io.PrintWriter; import java.util.ArrayList; import java.util.Scanner; public class RetrieveNonSerializedFile { public static void main(String[] args) throws Exception{ ...

How to scan Wifi access point on Windows Mobile?

I need to scan Wifi access point on Windows Mobile and connect the one of scanned results. Currently I am using C# language, Windows Mobile 6.5 device, also to scan I am using the below code. [DllImport(wlanapi.dll", SetLastError=true)] I am using wlanapi.dll, but it seems that not possible to use on Mobile. Does anyone know about the...

Java: Using the Scanner class to read input from a file without pipeing.

I currently have an implementation of a program where I read in the input using the Scanner class. Integer by integer. I do this by piping the input file via the command line. java program < input.txt I need to avoid piping the input by using an argument on the command line to open the file in my program. java program --file=in...

Java Scanner() to read from Array

Hi, I know you can set the input for a scanner in Java. Is it possible to feed an array to the scanner? ...

Java Scanner - why do I get this error?

I'm not new to java, but I cannot figure out why I get this Scanner error. The code compiles fine, but I get the following runtime error Enter item number: Exception in thread "main" java.util.InputMismatchException at java.util.Scanner.throwFor(Scanner.java:840) at java.util.Scanner.next(Scanner.java:1461) at java.util.Scan...

Keyboard Input In A Seperate Class?

Just started learning Java a week or so ago. I have made a little Java program that calculates the amount of reviews, and the average review rating that something has. For instance, on the app store, you would enter in 1 star, 2 star, 3 star, 4 star, and 5 star reviews and the program would calculate the average review score. Anyway, ...

.useDelimiter to parse commas but not negative sign

So I have looked at a couple of related questions, but still can't seem to find my answer (I guess because it's specific). I'm trying to use the Scanner.useDelimiter method in Java and I can't get it to work properly... here is my dilemma... We are supposed to write a program that takes a X, Y coordinate and calculates the distance bet...

Java Scanner Class Help

I would like to find out how to print a a certain string from an input file using a scanner. For the string to be printed the line must start with *star and the string must be surrounded by quotation marks, and be the next token and on the same line as *star ignoring white space of course. Sample input text file: "test.txt" this is...

What methods, other than listening for Probe Requests, can be used to find 802.11 wifi devices?

I'm writing a Python module for finding nearby WiFi client devices. All my current scanner does is listen for Probe Requests and logs the clients MAC address. The problem I'm having is that I'm completely reliant on the device broadcasting a probe request for me to discover it. I'm wondering if there is any other way to discover devic...

How to write a port scanner listening for 'ACK' in python?

please can anyone help me with the port scanner program to scan ports on the IP address provided,for ACK. i want to know the technique used to scan for ACK & use multi-threading so please help me in that perspective. Thank you ...

1. Scanning current (as opposed to next) line location. 2. Scanning line X (Java Beginner)

let's say I have a text file I'm inputing text from... File file = new File("example.txt"); Scanner inputFile = new Scanner(file); if I want to reference the next line of text I would do inputfile.nextLine(); Let's say I want to reference that same line of text again. Is there like a "currentLine()" method? What else could I do?...

app with Scanning functionality for iphone os 3.x+ with framework of os 4.0+

I am currently developing one application which needs the barcode scanning facility for that I am planning to use the scannerkit SDK, What I want is to build the application for the iphone os 3.x+ but the some framework(CoreMedia and CoreVideo) which scannerkit sdk uses are part of os 4.0+, I had linked this two framework weak, so that I...

Using string taken from Scanner not working?

When I run the program and enter a rank & gender it yells at me and tells me it is an invalid gender. I cannot see why if I enter "male" into the console, it does not equal the string "male"? Can please explain to me why this doesn't work and perhaps some suggestions on how to fix it? Thanks! import java.io.File; import java.io.IOEx...

What is the state of TWAIN on the Macintosh today?

I'm currently working on a project where we want to interface with TWAIN scanners on both the PC (Windows) and the Macintosh. On Windows, we basically have everything squared away and the code works successfully with the vast majority of scanners. On Mac OS X, we also basically have everything working and with the main scanner we used...