Java delimiter for multiple white space

Hi
Is there a delimiter for multiple spaces? Or is there a simple way to check for more than one space and then replace them with a single white space or another delimiter?
Thanks
Brian
Edited by: borratt on Apr 2, 2008 5:18 AM

borratt wrote:
So StringTokenizer should not be used at all anymore?
Basically I am reading in a file which is separated by spaces, but some of the names have a space in it.
I can split most of it fine due to the numerical only value at the beginning and the bracket etc.
1 john frank                              football (89)          456
tennis (76)             59
19 dennis the mennis                      cricket (83)           678
rugby (123)            567
It is not obvious to me what you are trying to do though if you are trying to split a line at points of more than one space then you just needString[] splitLine = line.split(" {2,}");

Similar Messages

  • How can I maintain multiple white spaces in a PDF written from InDesign?

    I need to have 2 white spaces maintained (within a part #) in the PDF I write, but when I open in Acrobat it converts it to one space.
    I've tried word spaces, set spaces and applying "no color" to a placeholder character and nothing is working!
    Any ideas or suggestions?

    I am talking about normal white space. Multiple fixed widt spaces are not a problem. How the space is handled in a PDF depends on how it is created.
    Viele Grüße
    Wilhelm Georg Adelberger
    Von meinem iPhone gesendet
    Am 21.08.2014 um 12:01 schrieb Peter Spier <[email protected]>:
    How can I maintain multiple white spaces in a PDF written from InDesign?
    created by Peter Spier in InDesign - View the full discussion
    It may not be a great idea to use multiple spaces, but it certainly is not prohibited and sometimes is necessary -- you might want a 2em space, or a thin space before and after a tab you underline in a form.
    I'm able to select the multiple spaces just fine in Acrobat 9 using the text touch-up tool.
    Please note that the Adobe Forums do not accept email attachments. If you want to embed a screen image in your message please visit the thread in the forum to embed the image at https://forums.adobe.com/message/6661037#6661037
    Replies to this message go to everyone subscribed to this thread, not directly to the person who posted the message. To post a reply, either reply to this email or visit the message page:
    To unsubscribe from this thread, please visit the message page at . In the Actions box on the right, click the Stop Email Notifications link.
    Start a new discussion in InDesign by email or at Adobe Community
    For more information about maintaining your forum email notifications please go to http://forums.adobe.com/thread/416458?tstart=0.

  • I need java decompiler for multiple class

    Hello, i need a java decompiler for multiple class.
    avoiding of decompile one to one.
    Thanks

    Use JAD it has recursive decompiles.

  • Delimiter for multiple display fields

    Hi ,
    Is there any way in MDM so we can change the delimiter for multiple display fields.
    Suppose for a lookup table code and description both are display fields.In Data manager when we select main table as our current table ,value in that lookup field will appear as code,description ,but as per the requirement it should be hyphen separated i.e code- description.
    Is there any way we can change the delimiter.
    Thanks in Advance
    Regards,
    Neethu Joy

    Hi Neethu,
    No, there is no way to change the delimiter but I can suggest you some workaround.
    Create one more field in same lookup table and mark it as display field. Create one assignment with the expression code&"-"&Description and put it in workflow having trigger action = Record Create and Record Update with Automatic launch action. With this, whenever you modify lookup data i.e. either code or description workflow will automatically update the third filed.
    Just check if this fits in your requirement.
    Regards,
    Jitesh Talreja

  • Find and replace for multiple thin space with enter...

    Hi,
         Im new to the InDesign Scripting.  I need to replace multiple thin space with enter to single enter.  Dont know how to do.  Pls someone help me.
    Thanks in advance,
    Sudha

    Hi Sudha,
    Use the Sample code,
    app.findTextPreferences = null;
    app.changeTextPreferences = null;
    app.findChangeTextOptions.wholeWord = false;
    app.findChangeTextOptions.caseSensitive = true;
    app.findChangeTextOptions.includeMasterPages = false;
    app.findTextPreferences.findWhat = "<2009>^p";
    app.documents.item(0).findText();
    app.changeTextPreferences.changeTo = "^p";
    app.documents.item(0).changeText();
    app.findTextPreferences = null;
    app.changeTextPreferences = null;
    Regards,
    Nagaraj

  • How to detect  multiple white spaces?

    Hi,
    I am working on an assignment where I have to read from a file and initialize the fields of my graph based on the input.
    My problem is determining the input to be assigned to some field with some rule on the input file.
    The input file will consist of 2 city names and the distance between them.
    - Zero or more space is allowed to preceed the first city name
    - one or more space between first city and second city, - - one or more space between first city and distance.
    Example:
    San Diego Boston 150
    So I have to assign city1 = San Diego
    city2 = Boston
    distance = 150
    I tried to do it with string tokenizer and string manipulation(like indexOf() and length()) but it does not seem to be working.
    Any help will be appreciated.
    Thanks!

    Sorry for the added ugliness, but this works:import java.util.regex.*;
    public class Test
        public static void main(String[] args)
            String s = "    'San Diego' Boston    123   ";
            Matcher m = Pattern.compile("('[^']*')|([^ ']+)").matcher(s);
            while(m.find())
                String g = m.group(1);
                if(g == null)
                    System.out.println(m.group(2));
                else
                    System.out.println(s.substring(m.start() + 1, m.end() - 1));
    }I'm still a bit new to regex ;) None of this is probably helpful to you if you don't have 1.4, but at least I'm having fun :D

  • Syndicator - Specifying delimiter for multiple-valued field

    Hi,
    How can (if we can, that is) we specify a delimiter to split a multi-valued source field into multiple fileds in MDM syndicator? I believe if we have <b>';'</b> as delimiter we can spilt a multi-valued field into multiple fields but what if I have <b>'/'</b> or some other character as a delimiter. Can I use that to split my multi-valued field? If yes then how?
    Regards,
    -Y

    Hi Yasir,
    I doubt whether we can anywhere specify the delimiter in syndicator from ';'  to  anyother as you mentioned, but otherwise the multi-valued field steps as follows...
    1. right click on the field from the source grid
    2. choose Split Multi-Valued Field > n
    3. The Syndicator adds the split items to the Source Items grid
    hope this might helps...
    cheers
    Alexander

  • White space in regular expressions (Pattern class)

    Hello,
    I have to check if a String contains ONLY the following characters: a-z, A-Z, ' and ( ) .
    The regular expression that I wanted to use with the Pattern class was [[a-zA-Z][\u0027][\u0028][\u0029][\s]] .
    Now, my compiler (Eclipse) doesnt recognize \s as an expression. Is this the proper expression for a white space?
    Also, in this notation, will the Pattern check for the order of the characters, cause the order isn't supposed to matter.
    I would appreciate any help you could give me on this subject.
    With Best Regards, Roderick

    I'm not a regex expert, but I don't see any of the regex gurus online, and this I can tell you.
    my compiler (Eclipse) doesnt recognize \s as an expressionYou need to escape the backspace in a String literal. Use"\\s"
    in this notation, will the Pattern check for the order of the charactersFor that I think (note:think, not know) you need to put the entire set of characters to be matched in one character class. Could you try this and post back whether it works for your requirement?"[^a-zA-Z'()\\s]"Note the negation operator at the start of the characer class, which will match positive for any character not in the character class.
    db
    edit You can test your regex here:
    {color:0000ff}http://www.dotnetcoders.com/web/Learning/Regex/RegexTester.aspx{color}
    but remember to double the backslashes whe you include it in your java code as a String literal.
    Edited by: Darryl.Burke

  • Adding custom stamps to many pages in white space.

    Is there any way to add a custom stamp to every page of a PDF book and having it placed into the white space on the document? I have found a script that will do every thing except for the 'white space' part of my query, so I don't think I will have much luck.
    Watermarks will probably not work in this instance, the stamp needs to be noticible but not in the way, and the watermark will encouter the same placement problem (as it is preferable if the stamp/watermark is not getting the in way of the drawing pdf's content).
    Any help will be appreciated, just let me know if you need more clarification.

    The question is what do you mean by "white space"? Is it always the same area on the page (like a 2" margin), or is it a different location for each page, where there happens to be no text or images? The former is possible, the latter only partially, and is very difficult to implement with a script.

  • How do you get rid of white space when you are printing multiple pages to one sheet of paper?

    How do you get rid of extra white space when you are printing multiple pages to one sheet of paper?  When printing multiple pages to one sheet of paper Acrobat won't let you select the "zoom" for printing.
    Thanks

    Take a look at Quite Imposing.

  • White space around image when doing Save for Web

    Say I draw a simple square in Illustrator CS6 then export it to a PNG using Save for Web. The preview shows 1px thick of white space on the right side. Sometimes it's on 2 sides or more.
    No other hidden elements are around the image. Clip to artboard in not clicked.
    Why does this happen and how do we get rid of it?

    For once I get to answer a post and say somehting good about align to pixel grid.
    Turn it on
    Your image will now align to the pixel grid
    Turn it off when not doing web work, or will drive you mad.

  • Conditional Build Tab for image leaves extra white space

    I've applied the "Print" Conditional Build Tag to an image in
    my online help. When I generate the help and view it in the
    browser, extra white space is inserted between the steps. For
    example, instead of the steps being:
    1.
    2.
    3. etc.
    They now look like this:
    1.
    2.
    3. etc.
    Why is there extra white space where the image used to be?
    Thanks in advance for your help. Using RoboHelp7 -- WebHelp.
    Bill

    Probably there is a paragraph break or a space that you can't
    see but is not enclosed in the conditional tag.
    Check the html code immediately before and after the tag.
    Harvey

  • Search for White space within strings

    create table emp_dtl
    (empname varchar2(23));
    Insert into emp_dtl values ('WAYNE');
    Insert into emp_dtl values ('JOSEPH KRUPP');     --------- has white space
    Insert into emp_dtl values ('YING ZONG LEE');    --------- has white space
    Insert into emp_dtl values ('COHEN');
    Insert into emp_dtl values ('MARIE');How can i search for empnames which has White space in it? From other OTN threads, I gathered that this has something to do with
    chr(32)But i don't know how to put this in LIKE operator.

    Hi,
    SELECT  *
    FROM    emp_dtl
    WHERE   REGEXP_LIKE (empname, '\s')
    ;will look for any kind of whitespace (including spaces, which are CHR (32)).
    It may be more efficient to specifically list all the different whitespace characters, and see if the string changes when you remove all of them:
    SELECT     *
    FROM     emp_dtl
    WHERE     empname != TRANSLATE ( empname
                           , 'x ' || CHR (9)     -- CHR (9)  = <tab>
                                          || CHR (10)     -- CHR (10) = <newline>
                                 || CHR (13)     -- CHR (13) = <return>
                           , 'x'
    ;Edited by: Frank Kulash on Jul 12, 2010 8:47 AM

  • Found 0 results for While browsing eBay, when I watch or bid on an item, and later view it again, many inches of white space appears before item appears. If I delete the clear recent history box, the pages will come up as they should for several times, th

    While browsing eBay, when I watch or bid on an item, and later view it again, many inches of white space appears before item appears. If I delete the clear recent history box, the pages will come up as they should for several times, then go back to a lot of extra white space. How can I prevent this? Thank you, Rick in English
    == This happened ==
    Every time Firefox opened
    == About a month ago

    As stated in 1.:
    1. This procedure is a diagnostic test. It changes nothing, for better or worse, and therefore will not, in itself, solve the problem.
    Obviously, it will not harm your computer provided you follow the instructions. However, if you don't post your results in the thread where you were given those instructions, then the person helping you cannot help you further. As he asks at the end, "please post the test results on Pastebin, then post a link here to the page you created."

  • How do i crop "out" a piece of image=ex: how it will look when its cut for a window. Crop a white space in image?

    How do i crop "out" a piece of image=ex: how it will look when its cut for a window. Crop a white space in image?

    I think this will help if you are using version 11 or 12.
    Make a selection with a selection tool of the area you want to remove.
    Example: rectangular marquee tool - make a rectangle.
    Use Select>Refine Edge:
    Use the View section of this dialog box to see a few views.
    If you need to refine the edge of the selection (smooth, feather, shift, etc.) you can do that in this dialog box.
    You may want to check the box about remembering your settings in case you need to come back to them.
    In the Output section, you can pick New Layer with Layer Mask and click OK.
    You should see the hole in your image.
    Kathy Keith
    @kathleenmadeline on Instagram
    (I teach Photoshop Elements classes)

Maybe you are looking for

  • Driving external display

    I've been using my Macbook Pro with the external display (apple 23' cinema display). As recommended, I'd start the macbook pro, then close the cover, connect the display and press a button on an external keyboard. This will wake the computer up, and

  • 648 max, Win98 NDIS.vdx driver prob?

    Just installed Win98 on my new 648 Max. It installed ok, but on statup it says error: NDIS problem (forget the exact wording), you must restart computer. I bypassed NDIS.vdx with safe mode step by step start, and removed Dial up Network in control pa

  • Weblog & podcasting

    I setup a 10.4 server to do some podcasting. The server is up, weblog enabled. I am able to upload a podcast to the server to our test account. I can go to the server and download the podcast, what I can't do is subscribe to the podcast via iTunes or

  • MAJOR THREAD

    CONSOLE... QPixmap: It is not safe to use pixmaps outside the GUI thread QPainter::begin: Cannot paint on a null pixmap QPainter::end: Painter not active, aborted QPixmap: It is not safe to use pixmaps outside the GUI thread QPixmap: It is not safe t

  • How to downgrade EFI 1.8 to 1.7 on Macbook Pro 5,1 (late 2008)

    I need to downgrade my EFI 1.8 to 1.7 and then 1.7 to 1.6 to be able to use my new hard disk Western Digital 640GB blue. Can anyone send me the link of the dmg? Thanks in advance!