Questions tagged [stringtokenizer]

StringTokenizer is a Java class that breaks a string into tokens.

This tag is used for questions about or involving the StringTokenizer class in Java, which is used to break a single string into multiple, individual "tokens".

StringTokenizer is an old class, called the "legacy class" in documentation, suggesting to use String.split instead. However as of 1.7, it is not deprecated. Another class with similar but more advanced functionality is .

Questions tagged should also be tagged .

Useful links:

627 questions
-1
votes
1 answer

parse CSV file .. problem with managing primary key?

i just created a java file to parse a csv files and saved them into an oracle database.. but i need a field ID which acts as a primary key.. and i am a bit confused abt looping..
Praneel PIDIKITI
  • 18,677
  • 13
  • 41
  • 60
-1
votes
1 answer

Getting NoSuchElementException using Scanner class

I am getting the infamous NoSuchElementException when reading from a "|" delimited text file using the scanner class. I am taking the values of each token and assigning them to values within a separate class using setter methods. I can't seem to…
-1
votes
1 answer

What are Parse Html token methods for email templates in golang?

I am trying to create email templates having html tokens in golang. I have searched all over the web and found "html/template" library. It supports token format like below Hello {{.Name}} Confirm email address But the…
MKB
  • 777
  • 1
  • 9
  • 27
-1
votes
1 answer

Issues in splitting logic

Hi I have below string and I have to split and put in a map . While splitting through string tokenizer or .split method i am not getting the result i want.Below is my…
-1
votes
2 answers

String line or StringTokenizer with a Reader?

I had a file to read and with this code I succeeded my JUnit tests. As you can see, I pass the String line as parameter to the readPrevisione(...) method. package oroscopo.persistence; import java.io.BufferedReader; import…
Sharkbyte
  • 21
  • 9
-1
votes
3 answers

Extract numeric values between 2 characters in EditText android

I have list of food prices displayed in an EditText, so how can I iterate over them and extract all prices? For example here I want to extract prices between : and L . I was trying to use StringTokenizer but don't know how to use it...
André Abboud
  • 1,864
  • 2
  • 14
  • 23
-1
votes
1 answer

Trying to use strtok() for a shell function in C

I am trying to tokenize the user inputed commands for a shell program. The program runs but I don't think that it is filling the param array I have declared. I'm sorry if it seems that I don't have a ton of information as I am learning this as a do…
-1
votes
2 answers

Exception in thread "main" java.util.NoSuchElementException

i have a file that consist like this /1/a/a/a/Female/Single/a/a/January/1/1920/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a/a and here is my StringTokenizer code: public void retrieveRecords(){ String holdStr=""; try { …
lels
  • 5
  • 2
-1
votes
1 answer

Why doesn't StringTokenizer understand the nextToken function?

I made a calculator and now improving it so that it reads one line of code and turns it into three variables a: first number, b: second number, and function: what it does example: 10 * 10. This is my code: System.out.println("problem: "); problem =…
TheLittleCoder
  • 21
  • 2
  • 11
-1
votes
1 answer

how to split multiple line input using split function java

i want to split a multiple line input using split function when i tried it it was not working public static void main(String [] args) { String TER = ","; int i=0; java.util.Scanner a = new java.util.Scanner(System.in); …
-1
votes
1 answer

String Tokenizer and input file reader

I have a program where I have a text file, I have to read that text file and display output in term of returning product id to return product object with properties id,name,qty,price. But i have to do it using string tokenizer. If anybody has any…
John
  • 73
  • 1
  • 8
-1
votes
2 answers

Best efficient way to split this pattern

I have a file which includes thousands of lines like this: node: { title: "0" label: "sub_401000" color: 76 textcolor: 73 bordercolor: black } What I need is to extract the title value and label value. For example in the line above. I need to…
Alex
  • 303
  • 1
  • 6
  • 17
-1
votes
2 answers

How do I implement HashMap in my code, I am trying to use it as a memory?

So I am working on a PostFix calculator that is used in command line for a class project, and I am having a little trouble on developing a memory for it. I have been told to create a hashMap and I have researched it and understand the basics of it.…
-1
votes
4 answers

How to set the stringtokenizer's delimiter to break text into units with a given length

I have this sequence "ggtacctcctacgggaggcagcagtgaggaattttccgcaatgggcgaaagcctgacgga" and I want to break it into 3char length units like ggt acc tcc ..etc?
Raed Tabani
  • 217
  • 3
  • 7
-1
votes
1 answer

typecasting with StringTokenizer

I need to convert the output of nextToken() to type int and double. The way i'm doing it currently does not work and gives me the error saying java.lang.String cannot be converted to int. how else can this be done? Thank you! int id,age; …