Spliting a string based on Non Printable character

Hi,
i have a requirement where i have to split a String based in non printable character " MYU(ascii: 230);
es: ""This is to test æ raaaaaaaaaaaaaaaaa æ AAA010224544 æ 7118288888 æ
æ is a not printable character and its ascci is 230..
iam getting that string from form how to split it in Java..
Any suggestions...?

One of many ways
    String initString = "This is to test æ raaaaaaaaaaaaaaaaa æ AAA010224544 æ 7118288888 æ";
    String[] tokens = initString.split(String.valueOf((char)230));
    for (String string : tokens)
      System.out.println(string.trim());
    }

Similar Messages

  • Error converting data type varchar to numeric - maybe non printable character?

    Hello all. I'm having some trouble converting a column in my table from varchar(50) to decimal(20,4). I've also tried to convert it to int and had no luck. In trying to find the records with non numeric data, I ran this query...
    SELECT *
    FROM [table]
    WHERE [column] not like '%[^0-9]%'
    My result set was 32 rows where the field in question had zeros. This doesn't make sense to me. If it was a real zero, it would have been excluded from the query.
    So, I flipped it around and ran the following query, and got the same results.
    SELECT *
    FROM [table]
    WHERE [column] = '0'
    If it's really a string 0, what would keep it from converting to a numeric type? I'm wondering if there are non printable characters in there because this table was populated via SSIS package using a flat file.
    Thanks for any help you can provide!
    WeeLass

    I have discovered one of the values that will not convert. It is '-1.2317    ' and I tried RTRIM and those trailing spaces stay there.
    It has a length of 8, and ASCII value of 45, and converting to varbinary gives 0x2D312E3233313709.
    The 45 and 2D both point to a negative sign. This one does indeed have a negative sign, but it's in the front, not trailing. Also, another value that was failing was not negative, but did have the trailing spaces.
    Any ideas on how to figure out what those spaces actually are? Hopefully, if I know that, then I can know how to get rid of them.
    WeeLass
    It may be a hard space
    RTRIM trims only soft spaces
    try this and see if works
    REPLACE(ColumnName,CHAR(160),'')
    Please Mark This As Answer if it solved your issue
    Please Vote This As Helpful if it helps to solve your issue
    Visakh
    My Wiki User Page
    My MSDN Page
    My Personal Blog
    My Facebook Page

  • How to add non printable character in label

    hi ,
    I want to add white space or tab in label of output label
    thanks

    Hi,
    have you tried   for blank and "	" for tab   ?
    Frank

  • Inserting strings of printable and non printable characters

    I would very much appreciate some help with the following
    To handle an interface with a legacy system I need to create strings containing both printable and non-printabel ascii characters. And with non printable characters I mean in particular those in the range of ASCII 128 to 159.
    It seems it is not possible to insert a string containting both printable and not printable characters from the afore mentioned range into a VARCHAR2 table column as the following demonstrates:
    insert into test values(chr(156)); -- this inserts the 'œ' symbol.
    SQL> select test, ascii(test), length(test), substr(test,1,1), ascii(substr(test,1,1))from test;
    TEST       ASCII(TEST) LENGTH(TEST) SUBSTR(TEST,1,1) ASCII(SUBSTR(TEST,1,1))
    ┐                  156            1That the the character mapped is shown as '┐' and not 'œ' is not really issue for my application, what is important is that the ASCII value is shown as 156, which is the ASCII code of the character I inserted.
    What is however strange (actually probably not strange but has to do with the lack of understanding of the issue at hand) is that substr returns an empty string...
    Now I try to insert a concatenated string, first the "non printable" character then a printable character
    insert into test values(chr(156)||chr(65));
    SQL> select test, ascii(test), length(test), substr(test,1,1), ascii(substr(test,1,1))from test;
    TEST       ASCII(TEST) LENGTH(TEST) SUBSTR(TEST,1,1) ASCII(SUBSTR(TEST,1,1))
    A                   65            1 A                                     65For some reason the not printable character (chr(156)) is now not inserted or at least does not appear when I selected the data from the table, this effect seems to apply to all characters in the range of ASCII 128 to 159 (tried some but not all) However for instance CHR(13) can be inserted as part of a string as shown above .
    For our application I really don't care much what character is shown or not show, what is important is that I can retrieve the ASCII value and that this value matches the one I inserted which for some reason does not seem to work.
    This seems to be, at least to some extent a character set issue. I have also tested this on a database with character sets set as follows
    NLS_CHARACTERSET
    WE8MSWIN1252
    NLS_NCHAR_CHARACTERSET
    AL16UTF16
    With WE8MSWIN1252 the described issue does NOT occur, however unfortunately I must use NLS_CHARACTERSET AL32UTF8 which produces the results as described above!
    As said any insights would be much appreciated as I am slowly but surely starting to despair.
    For completions sake, character sets are set as follows (changing it is NOT an option):
    NLS_CHARACTERSET
    AL32UTF8
    NLS_NCHAR_CHARACTERSET
    AL16UTF16
    The test table is created as follows
    CREATE TABLE TEST
    TEST VARCHAR2(1000 BYTE)
    Database Version 11.2.0.3.0
    Edited by: helios.taraba on Dec 2, 2012 10:18 AM --Added database version
    Edited by: helios.taraba on Dec 2, 2012 10:24 AM Added description of test results using NLS_CHARACTERSET WE8MSWIN1252

    Hello Orafad,
    Thanks for your reply, at least I understand the effects I'm seeing i.e.
    +"For multibyte character sets, n must resolve to one entire code point. Invalid code points are not validated, and the result of specifying invalid code points is indeterminate."+
    http://docs.oracle.com/cd/E11882_01/server.112/e26088/functions026.htm
    You are absolutely right I could use chr(50579) to get the ligature symbol. However as what we are trying to achieve is to implement a legacy interface to a 20+ years old subsystem we are actually not so much interested in the symbol itself but rather in the ascii value of that symbol (156 as you so rightly point out in the win-1252 characterset), this particular field represents the lenght of the message being sent to the subsystem and can vary from decimal 68 to 164 and is also considered in a checksum calculation which is part of the message.
    As changing the nls_characterset of the database is not an option I guess I only have one reasonable avenue to resolve this namely to push the functionality to added the "encoded" length of the message (and the calculation of the checksum) to the java driver which is responsible for sending the message (tcp/ip) to the subsystem. Here we should not have any issues adding a byte with the value 156 (or any other for that matter) to the datastream.
    Thankfully all other fields have characters with ascii values below 128 and above 31.
    I'm going to leave my question as un-answered for a bit longer in the hopes of someone coming up with a golden bullet, although not getting my hopes up.
    Thanks, Helios

  • Storing a Non Printable -from keyboard- Character in Varchar2 Column

    Hi,
    I want to store a non-printable character in a varchar2 column. This character should be non-printable -from keyboard- for all character sets -or very difficult to print from keyboard-. It doesn't matter, whether it can be displayed on screen or not. It does matter INSTR function returns the character position of that character. It should be able to import export data without any problem for any NLS specific operating environment. For example, I plan to use chr(1) do you think it's appropriate? I appreciate your helps.
    Best Regards,
    Salim

    What is the business requirement you're trying to satisfy?
    If your database character set is based on ASCII, CHR(1) (the Start of Header) character is likely to be transferred between systems without character set conversion. Non-ASCII character sets (i.e. Big5 for Chinese data) don't necessarily share the same control characters, though, and generally won't have the same binary representation of an ASCII control character (so CHR(1) in a non-ASCII based database wouldn't necessarily return the same character that CHR(1) would in an ASCII based database).
    Justin

  • Select xmlelement of clob containing non-printable chars gives ORA-31011

    Using sqlplus against Ora9i database. We have some rows where the CLOB column contains non-printable chars because of a conversion from an old system.
    I'm trying to extract this data using xmlselect. Most of the time it works great, but for the above rows it dies with error:
    ORA-31011: XML parsing failed
    If I embed substr(columname,1,25) so that it doesn't get to the non-printable character (which is at about position 200), then the sql works great.
    Any ideas on how to massage this data, either on the fly, or I could do a one-time conversion. The problem is that darn CLOB. I can't even figure out how to find all the bad rows. Looking for sql to find the bad rows, or a function that I could put in a package, and then call from the select to convert it on the fly.
    thanks,
    Rick

    Thanks for your help. Anything I do (including your suggestion) to try and parse the xml bombs with an internal error. Without raising the exception.
    What I decided to do instead is do a search in the clob using instr(column, CHR(13)) but for also all CHR that are less than 32. I then replace it with a space. So I'm going to fix the data once rather than doing an on the fly fix.
    thanks again,
    Rick

  • How to show non-printable characters on the new pages

    I know some Pages features had been removed, some of them add again, and some hidden. So, I would like to know if it is possible to show the non-printable character on this new version.

    Same as old:
    Menu > View > Show Invisibles
    or
    command shift i
    Peter

  • Non-hex character in hex string after upgrade to Yosemite

    Hi,
    When I try to open some of my files I get an error: "Acrobat PDF File Format is having difficulties. Non-hex character in a hex string". I could open the files before.
    The only thing I've done since I opened the file last was to upgrade to Yosemite. The error occurs on both my Mac Pro (late 2013) and Mac Book Pro with Yosemite. Unfortunately, I have no access to a Mac with Mavericks and CS6 but I will try to fix one to verify that the file works there.
    Affected files  (Created in Illustrator CS6 on Mavericks):
    services.ai
    visual guidelines v.0.4.pdf
    visual guidelines.ai
    Tested steps:
    Open previous versions of the same file from our repository
    Update Illustrator CS6 to latest version
    Download Illustrator CC
    Tried to Place the file into another file (same error)
    Tried to repair file Enable content recovery mode | Illustrator CS2-CS5

    Hi svepdesigncenter,
    How you are accessing those files from your repository?
    There might be chances of getting files corrupted when transferring.
    File may have been sent as ascii when it should have been sent as binary or vice versa.
    In 99% of transfers it's ALWAYS safest to zip an AI or eps file before sending it anywhere.
    Regards,
    Sumit Singh

  • Non-hex character in hex string

    I'm getting this messsage when I try to open an Illustrator file:
    "Acrobat PDF file format is having difficulties. Non-hex character in a string."
    I', using illustrator CS6 and I need my file opened..!

    Nobody can know without seeing the file and having more info about your system. Does the file open in Acroibat/ Adobe Reader for instance?
    Mylenium

  • Non-hex character in a hex string error message

    Hi everyone,
    I encountered n error message in Illustrator "Acrobat PDF File Format is having difficulties. Non-hex character in a hex string." when trying to open a particular file.
    File was originally created on a Windows 7 PC, tried opening file on Mac OS 10.7.5, same Illustrator version 18. Also tried opening in PDF, Distiller, but didn't help.
    Did tried to change Illustrator Preferences in both Windows and Mac, following the steps in the TecNote:
    http://kb2.adobe.com/cps/500/cpsid_50031.html
    When trying to open the file from the File > Open menu, with the keys held down, it did not open a blank file window, neither did it created a duplicate copy in the Finder where the file is located.
    The file in question had about 15 artboards,  a few embedded images, approx 2.6MB size.
    Any suggestions/assistance would be greatly appreciated.
    Thank you.

    Hi Monika,
    The file was .ai file, as mentioned earlier, was created in Illustrator ver 18.
    Not emailed, stored in the folder, on the Windows PC, not a server. Last saved few days ago, tried to reopen the file from the same computer, but could no longer opened.
    No, Illustrator did not crash, just the error message "Acrobat PDF File Format is having difficulties. Non-hex character in a hex string."

  • Non-hex character in a hex string

    My Illustrator file will not open in Illustrator and I get the "non-hex character in a hex string" window whenever I try to open it. It does open in Acrobat but nothing else. I can't even save it as a pdf file..
    Is there any way I can get around that or fix it?

    karam,
    The first thing to try is to use File>Place in a new document and see how much, if anything, is saved this way.
    The next thing to try is to repair the file code, which is more difficult. The basics are told in this TechNote, the actual recovery consists of changing/adding/deleting code.
    http://kb2.adobe.com/cps/500/cpsid_50031.html

  • Non-Alphanumeric Character in a String

    I understand if we have a non-alphanumeric character in a String, we have to put a backward slash in front of that character. For example, we have to put a backward slach in front of a "backward slash". Eg. we do \\ to put a backward slash in a String.
    What about a dot (.) or a dash (-)? Do we have to do the same thing?

    No, it's only for control characters like "newline", characters with special meaning in strings i.e. " and \ and any character that can't be represented in the character encoding of your java source file.

  • Need help in removing non printable characters

    hi
    I am having an issue with non printable characters in webservice. This webservice dishes out xml in B2B communication to my clients programs. Due to data corruption in oracle (dont know who is creating bad data ) I am having non printable characters in the xml file which is generated from database. I am dishing out this to our customers. since the data in updated every day it is imposible to fix the data every time. I need to write a very very effficient method to strip non printable characters from strings from the xml. Can some one Please help on this one. I want to make sure this method is very efficient because this method could be potentially be called lots of times. I am using JDK 1.3.1 and oracle 8i
    Any help will be appreciated
    Thanks
    Ashok Pappu

    At some point you existing program is probably converting from String data to the XML bytes through a CharsetEncoder, probably inside a java.io.Writer.
    Perhaps your best approach might be to write your own java.nio.charset.CharsetEncoder which deals with the bad characters as you see fit.
    You can register a new java.nio.charset.CharSet as a private character set type. Because this should result in simply replacing a standard CharsetEncoder with a non-standard one hopefully the overheads would be low.

  • Non printable characters

    Hello
    I have seen some posts about this topic, but none helped me.
    I need to send to a device, via serial port (rs-232), four codes composed by printable and non-printable characters
    For instance, I need to send a string with ASCII character 224, ASCII character 87, ASCII character 10, ASCII character 0 and ASCII character 191, together in the same string
    Can someone help me to do this?
    Thanks

    What part are you having trouble doing?
    To create those ASCII characters you can use a  string constant or control set to '\' codes or hex display.
    Lynn 

  • Reading a non-english character

    Hi, I have a trouble with reading a non-english character from a html page.
    I'm taking the word from the html page, and compare it with itself,
    like this
    string.equals("BİTTİ")
    but it returns false.
    is it possible to correct this?

    specify an encoding for your inputstream reader:
    BufferedReader in = new BufferedReader(
                new InputStreamReader(new FileInputStream("infilename"), "8859_1")); for example

Maybe you are looking for

  • PSA request deletion Error

    Hi All, I have a problem for which i am not able to get the proper solution from the threads. Can anyone help me to solve this. I am getting this error "" RSDU_TABLE_DROP_PARTITION_MSS Error while creating the clone table /BIC/B0000183000" while dele

  • How Do I create an app??? NEED HELP

    I need to know how to start the process for creating an APP for apple and andriod. I have an andriod but i do have apple products as well., need advice ASAP. thank you.

  • Restoring iPod when not recognised in Itunes

    My brand new 80gb Video iPod has just frozen. I've gone through as much as I can find on here with the exception of restoring teh iPod software as I can't get it to come up in iTunes to access that area! Is there a way I can restore it without iTunes

  • File as Read Only

    Hello, When I am opening any file (DTR -> Edit ->) in NWDS, it' gets opened as Read only. I am unable to make any changes in it. Can anyone help? Regards, Shaun

  • Why won't iPhoto open?

    I've just tried to open iPhoto (5.0.4), the version that came with OS X and the only version I've got. iPhoto won't open. A dialogue box says: "You can't open your current photo library using this version of iPhoto. You have made changes to your phot