Multiple character delimiter

hi - i am attempting to parse values out of a text file using stringTokenizer. The values are delimited by a "<br>" tag. When I pass this to the stringTokenizer, I get some weird results making me think that it will only accept a single character as the delimiter: Example:
This is the text of a file that would be parsed
partText=<b>Transynd LLC.</b><br>Ken Lewis<br>303.641.5542<br>[email protected]<br>www.transynd.com
After extracting this text from the file, it is set to the var 'news'. stringTokenizer is then applied as such:
StringTokenizer st = new StringTokenizer(news, "<br>");
while (st.hasMoreTokens())
     out.write(st.nextToken() " ");
The expected resulting html is:
patText=Tansynd LLC Ken Lewis 303.641.5542 [email protected] www.tansynd.com
but in reality, i am getting:
patText=Tansynd LLC./ Ken Lewis 303.641.5542 [email protected] www.tansynd.com
notice that it removed most of the opening and closing bold tags - no idea why. and left the '/' from the closing bold tag - again no idea why.
NOTE: i am having it write to html just for testing purposes. in actuality, i will be building an array of these values so that they can be accessed later.
Any ideas how i can parse these values using "<br>" as my delimiter? Any help would be greatly appreciated.
-d

From the javadoc for StringTokenizer constructor:
public StringTokenizer(String str,
String delim)
Constructs a string tokenizer for the specified string. The characters in the delim argument are the delimiters for separating tokens. Delimiter characters themselves will not be treated as tokens.
So the string is being split on any instance of '<', 'b', 'r', or '>'. It doesn't look like you're going to be able to use StringTokeizer to do what you want. You will probably have to write your own tokenizer. You can use String.indexOf( String ) to find out where "<br>" is in your string, and then use String.subString( int, int ) to extract the chars between the <br> tags.

Similar Messages

  • Passing multiple character values from parameter form to PL/SQL

    Hi,
    I am passing multiple character values from parametr form into
    the report query and a PL/SQL procedure. It works fine with the
    query, when I use &variable. But, it doesn't compile in PL/SQL,
    so I just used the :variable, but not getting any records in the
    PL/SQL procedure. Any suggestions?
    sincerely,
    gj

    gj / Fedro,
    Only using the &referecne, you can pas a string / multiple character values and this would work for query only.
    The bind parameter in PL/SQL wouls support only single value
    Thanks
    The Oracle Reports Team

  • Matching across multiple character sets

    Would like to know whether anyone has attempted matching across multiple character sets, for example, between English and Japanese: what are the pitfalls to avoid, what are the best practices, and what you would like to see from application/tools perspective as an ideal solution. thanks

    If you upgrade to Logic Pro, you'll get WaveBurner as part of the package which helps you do this, including tweaking your pauses between tracks, fades etc.
    If you have Toast, you can do it there too.
    If you don't have any 3rd. party software, the work around would be to assemble all your songs in order, end to end in a new Logic file, and listen to all your tracks and adjust the relative levels between songs, then bounce out the individual tracks which have volume changes with their new volume settings. Finally you could then use any burning app such as [SimplyBurns|http://bit.ly/c1oglP] to create CDs or bounce them out in Logic with the additional .mp3 option.
    Obviously it's important to listen to your material in order, in context, as some songs will be at the wrong subjective level depending on the tracks either side in the placement. This isn't really important in digital distribution where your material probably won't be listened to as a whole, but as individual downloads.

  • Report with pipe character delimited

    Hi all
    we have requiremnt to customize the report to pipe character delimited report output.
    Please advice me how to achieve this
    Thanks in advance
    Anu.

    do we need to opn the file in report trigger and select data from table then generate a file with delimited right?the sample code does the same
    but it a big report it have formula columns and place holder how can we handle those fileds?the loop can handle virtually biggest report/recs :>)
    and where it is saved the output file.depends, might local or networked drive etc. You can pass the file name/path by a parameter to the report.

  • Combining multiple Character Styles

    I'd like to apply multiple character styles to the same words. However, this does not seem possible. One character styles always overrides the other. Please see the attached image for a visualization.
    I tried Shift-clicking both styles to apply them, without success. I guess either I'm missing something quite obvious, or this is not possible?

    Geert DD wrote:
    I don't see why not? If you are a bit into webdesign, you may be familiar with CSS. Here is how you would combine multiple styles onto certain words.
    .red { color:red; }
    .underline { text-decoration:underline; }
    <p>HTML paragraph with some <span class="red underline">red+underlined</span> text.</p>
    CSS rules have a clear order of application (the "cascade"), so if there's any disagreement between rules applied to a given bit of HTML, the rule applied last "wins" by overruling any applied earlier.
    Unlike CSS classes, InDesign styles are not applied in any obvious order, so if more than one style could be applied to a given bit of text, there would have to be some way of ordering them so that disagreements between them could be resolved.
    The "based on" hierarchy of styles prevents style conflicts independently of any given bit of text. The ability to apply more than one style to a given bit of text would necessitate the introduction of a further ordering relation, one that applies only to the given bit of text.
    That could make things very complicated, and its effects would propagate into scripting, de-bugging, and so on. It wouldn't be just InDesign that had to get it right -- the poor befuddled user would too!
    Although I was kidding when I mentioned Russell's theory of types (and amused by the Peter Cook & Dudley Moore parody) I was gesturing vaguely towards the idea that there are some general/logical constraints on classification that go beyond individual applications such as InDesign.
    In general, the least problematic ways of classifying things use categories that are either disjoint or else ranked in a "containment" hierarchy. This is can be seen in many areas of life. For example, an animal can be a member of species A and genus X, but it cannot be a member of both species A and species B, nor a member of both genus X and genus Y. The syntax of XML reflects all similar ways of classifying things, and that is one of the reasons why it is so powerful.
    Jeremy

  • Export delimiters: ~R - is this just a straight 2 character delimiter?

    Group,
    We are doing exports from Oracle to other platforms and having delimiter problems - users inserted pipes, backslashes, whatever in the varchar fields.
    I am wondering if the ~R is a 2 character delimiter as it appears, or does it represent an escape sequence like \n (newline) or \t (tab) in Unix/Linux?
    Our Oracle team says ~R is literal, but I suspect it may not be.
    Thanks,
    Vince

    Group,
    Queston answered.
    I looked at an extract using the ~R and it is a literal character. Got a developer to send me a file (like pulling teeth) and looked at it with a hex editor - sure enough, 2 chars, a tilde and an R.
    Thanks anyway,
    Vince

  • Using Escape character for Multi character delimiter for flat files in IKM

    Hi
    I have an IKM using Jython, it is working fine for single character delimiter. But as per requirement I have to use multicharacter delimiter ;" (semi colon and double quotes).
    I am taking this into variable using
    filesep = "<%=snpRef.getSrcTablesList("", "[SFILE_SEP_FIELD]", "", "")%>"
    but it is giving lexical error.
    Can anybody help me with the use of escape character in current scenario?
    Any other suggestions are also appreciated.
    Thanks
    Ankit

    Hello,
    A small tweak may solve your problem:
    Instead of :
    CONCATENATE wa_condstr ' bukrs = ' pa_bukrs INTO wa_condstr SEPARATED BY space.
    Use:
    CONCATENATE wa_condstr ' bukrs = ' 'PA_BUKRS' INTO wa_condstr SEPARATED BY space.
    Then use this in SELECT.
    Anyways for your answer the escape character for apostrophe is an apostrophe )
    Try this you will understand:
    DATA:
    V_STR TYPE STRING VALUE ''''.
    WRITE: V_STR.
    BR,
    Suhas

  • ISA Level :: Repeating Character Delimiter Issue

    I am receiving an 850 EDI v 5010 X12 document form our trading partners which is being processed in B2B and forwarded to SOA for further processing. The data coming in in PO1 Segment is as under :
    PO1*00001*20*EA*12*UM*UP*085896392170*PI*497040453*VA*K39217US*SK*4103636*OT*1397
    B2B Successfully processed the EDI , but when i look at the Application message (XML), the Element-639, Element-235_1, Element-234_3 are getting generate improperly and not as per the specification or the data. For eg. Element-639 is only populating M instead of UM, similarly Element-235_1 is populating P instead of UP. (I am attaching the Application Message, EDI file, ECS used for this purpose and B2B configuration export)
    <Segment-PO1>
    <Element-350>00001</Element-350>
    <Element-380>20</Element-380>
    <Element-355_1>EA</Element-355_1>
    <Element-212>12</Element-212>
    <Element-639>M</Element-639>
    <Element-235_1>P</Element-235_1>
    <Element-234_1>085896392170</Element-234_1>
    <Element-235_2>PI</Element-235_2>
    <Element-234_2>497040453</Element-234_2>
    <Element-235_3>VA</Element-235_3>
    <Element-234_3>K39217</Element-234_3>
    <Element-234_3>S</Element-234_3>
    <Element-235_4>SK</Element-235_4>
    <Element-234_4>4103636</Element-234_4>
    <Element-235_5>OT</Element-235_5>
    <Element-234_5>1397</Element-234_5>
    </Segment-PO1>
    The issue I figured out was with the ISA Delimiters coming in the EDI File :
    ISA*00* *00* *14*001695568GT *12*4155722700 *120906*0038*U*00501*000000118*0*T*>
    The Repeating character delimiter in the EDI file is coming as U and hence any data containing 'U' is being treated as a delimiter by B2B. How can i override this? Is there a way B2B can preprocess and change the delimiters coming in the EDI file at ISA levels?

    The Repeating character delimiter in the EDI file is coming as U and hence any data containing 'U' is being treated as a delimiter by B2B.This is poor selection of delimiter. Character U can easily be part of data and hence it must not be chosen as a delimiter. This issue should only be fixed at sending side by either choosing a delimiter appropriately (so that it does not appear in data easily) or by using "Replacement Character".
    Regards,
    Anuj

  • How Data Integrator supports multiple character sets in a single ETL transaction

    <p>When using Data Integrator (DI) to process a mix of multi-byte and single-byte data, it is recommended that you use UTF-8 for the job server codepage. You can, however, use different codepages for the individual datastores.</p><p>Imagine this situation : Great Big Company Inc. wants to create a global customer database. To do this, Great Big Company Inc. must read from a database of US customers, and a database of Korean customers. Great Big Company Inc. then wants to load both sets of customers into a single database.</p><p>Can DI manage these requirements? Of course. The codepage is the thing.</p>

    I've never seen this used the way you are using it. In my experience the only way to do this would be to execute a single SQL statement that returns multiple result sets - you are trying to append two SQL statements.
    You could define an in-line procedure wrapping your two select statements, or you could define a stored procedure to do the same thing. Then (either way) use CallableStatement to execute the call to the procedure.

  • Multiple character sets on a single page

    JDev 11.1.1.5 - WLS 10.0.3.5
    I have an application that needs to have some fields in a different character set (like Amharic) and some in English.
    These are fixed - so when the user enters the field - it should already be in the different language.
    I use UTF8 for all my jspx. The fonts are unicode. The database is setup for NVARCHAR.
    I am using ADF.
    What do I need to do to create this kind of page? Where do I install the fonts? And how do I make the Input Text default to the appropriate character set for display/input?

    No, you can only have one <f:view> per JSP page (including any pages that page includes), and the locale must be the same for the complete response (because it's also used when the post-back request is parsed).
    It's hard to say from your description if this makes sense or not, but why don't you use static text for the part that is always in German, and only localize the parts of the page that needs it?
    Hans Bergsten (EG member)

  • Multiple character formats in a paragraph format

    Hi. I've searched the general discussion and did not find this issue.
    I have one paragraph format called Bomb that consists of a Wingding character (M) in the Numbering tab that prints a little black bomb in a side head. I combine with format with two other paragraph formats called Caution and Warning. These formats are in column and use a red, bold autonumber (CAUTION, WARNING) followed by a couple of spaces--the text goes immediately after the spaces.
    My bosses now want the bomb symbol and the CAUTION/WARNING word in the side head, with the text in column. I can't see how to combine that Wingding character with the regular Verdana word. I had to do something similar with my Note format, except that I put the word "note" by itself as a side head and created a format to follow it called NoteAft for the text.This way, I have a line with the Note format, followed by a paragraph return, then the NoteAft format for the text.
    I'd rather not have to use three formats to replace the existing two for Caution/Warning, so I hope y'all can help me figure out how to handle this thing.
    I appreciate your suggestions! BTW, I'm using FM 7.2 but will want to switch over to 9.0 when my bosses agree.
    Dimi Everette

    OK, I managed to answer my own question!
    Bomb para format: tab at 0.2 cm (not sure that's required...), Next Para tag is CAUTION; default font is Verdana; Run-In Head with no default punctuation; Numbering tab has Autonumber format checked, M in text field with Wingdings char format; defaults for Advanced and Table Cell tabs.
    I press Return and CAUTION appears.
    CAUTION para format: no tabs, Next Para is NoteAft; default font is Verdana; Side Head--Alignment: First Baseline; Numbering tab has Autonumber format checked, CAUTION in text field with RedBold char format; defaults for Advanced and Table Cell tabs.
    I press Return and type the text of the CAUTION in the NoteAft style.
    I'm going to change that Para tag to BombCaution and create another para tag with for BombWarning and be set! Of course this won't work unless your master page uses a column with room for side heads.
    If you know of something more elegant, please pass it along.
    Dimi

  • Multiple Character set for NLS

    Hi,
    I'm using Oracle 8i database. Is it possible to set the different character set for the database? The requirement is to support the two different character set data, one (main) Japanese character set and other Simplified Japanese. Or is there any other way in which i can store these data (Japanese & Chinese)?
    Thanks & Regards,
    Jayesh

    Please don't get me wrong. Currently it is set in the windows database. I did not set nls_lang at the command prompt before import into windows. However nls_lang is already set and it is character set WE8ISO8859P1 the same as the value I specified in creation script, besides the other two values AMERICAN, AMERICA. They are now same in both solaris and windows. Only the character sets are different because I specified a different one. So, is it ok or do I now need another fresh import this time with nls_lang set to AMERICAN_AMERICA.UTF8 ?

  • How to train OCR using VISION ASSISTANT for multiple character recognition

    Sir I have tried training OCR using Vision Assistant for character recognition. For the process i have used a fixed focus camera but the character i had trained were undetectable. So sir please provide me a liable solution to the problem.
    Thank you.
    I have attached my project description and also the .vi file of my work towards it.
    Attachments:
    Project phase I.vi ‏138 KB
    WP_20140814_17_27_38_Pro.jpg ‏1444 KB

    Can you post a real jpg instead of renaming a bmp to jpg?

  • Can we handle multiple fields delimiter in sql*loader

    Hi,
    Users wants to load the data from each of their individual system. But problem is when they save the csv file, due to their sytem setup some files gettng saved with pipe (|) seperated and on some system it is saved with comma (,) sepearted fields.
    Can we handle both these field seperator in control file?
    Please suggest
    Thanks,
    Rahul

    Rahul,
    I recommned you should use "|" as "," can be embedded in a text string. I guess you can pass a directive to use to deliver "|" delimited file :). If you want to handle both then you might have to write a shell script or bat to pass delimiter as an argument which will edit and replace your control file.
    Regards

  • No support for tab-delimited (or other character-delimited) data export

    First, to echo others' comments, I am thoroughly impressed with this project. This is a well-designed application that feels very professional and reasonably robust for beta. I only wish that Oracle had invested the resources to do this earlier.
    To the point, in the right-click pop-up menu within the data results tab there is an "Export" sub-menu. This menu has various options for exporting raw data. However, it does not provide the ability to export tab-delimited data or to change the delimiter arbitrarily.
    This feature is particularly important for data containing special characters. For example address data, even after parsing into standard fields, may still contain commas rendering a CSV export useless.
    This would be a very useful enhancement.

    There is an export to Tables in Microsoft Excel option. Did you try that?

Maybe you are looking for