Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8307481
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T18:31:57+00:00 2026-06-08T18:31:57+00:00

I am getting a NumberFormatException in talend ETL tool for the following statement: Integer.parseInt(+2);

  • 0

I am getting a NumberFormatException in talend ETL tool for the following statement:

Integer.parseInt("+2");

Error details:

Exception in component tJavaRow_3
java.lang.NumberFormatException: For input string: "+2"
at java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
at java.lang.Integer.parseInt(Integer.java:449)
at java.lang.Integer.parseInt(Integer.java:499)

Which is really a simple code that runs without any issue in my test java program.

public class Main { 
   public static void main(String[] args) { 
      String s = "+000000100"; 
      System.out.println(String.valueOf(new Integer(s))); 
   } 
}

Actually am getting this value from a positional file and the value can be something like +0002 or -0002 (Some valid number prefixed with sign). And one thing is sure there will not be any decimals in the input.

Thanks in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T18:31:57+00:00Added an answer on June 8, 2026 at 6:31 pm

    In your context +2 must mean a positive number 2. Watch out when passing strings to the function that does the parsing, because since it parses ints some expressions such as 3.5 or 3,5 (decimals) will not result like expected. Double.parseDouble or Float.parseFloat should be used in those cases instead if you have control over that code. On the other hand, negative numbers like -2 will be parsed withour any problem.

    EDIT: If you’re using positional files just remove the + from the beginning of your string either by using a regular expression or obtaining a substring. You can, also, use startsWith("+") to check if the string starts with +.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm getting a NumberFormatException on the Integer.parseInt() method. I know this exception is produced
I'm getting the error Exception in thread main java.lang.NumberFormatException: For input string: scores.txt at
I'm getting the following error when trying to parse the phone number, 5554567899 java.lang.NumberFormatException:
I am getting following error message: java.lang.IllegalStateException: Neither BindingResult nor plain target object for
I am getting Error java.lang.NumberFormatException: For input string: passing JSON array to Spring-MVC.. Here
I keep getting this error here: SEVERE: java.lang.NumberFormatException: For input string: at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65) at
I am getting this LogCat: 06-22 15:30:53.731: E/AndroidRuntime(2389): java.lang.NumberFormatException: Invalid float: null 06-22 15:30:53.731:
I am getting an error because of the following line of code: int x
Getting the following error, which I understand and have seen before. But one thing
Am trying to convert a String value to long, and am getting : java.lang.NumberFormatException:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.