Need to parse text

I'm trying to parse some text, and don't know which class to use. I was going to use StreamTokenizer, but can't find any documentation on it. Please don't tell me to search for it, I've done that.
The text consists of a word, followed by the slash "/" followed by another word. Using the StringTokenizer, I figured I could tokenize by whitespace, then by the slash, but that's a lot of work. I also need to parse up to the sequence "./." which is the sam format, but with periods.
Do you think StreamTokenizer will make this easier, or should I just kludge through it?
Thanks

The text consists of a word, followed by the slash
"/" followed by another word. Using the
StringTokenizer, I figured I could tokenize by
whitespace, then by the slash, but that's a lot of
work. I also need to parse up to the sequence "./."
which is the sam format, but with periods.Can you show some sample data, and the result you expect?
/Kaj

Similar Messages

  • Parse TEXT File??

    Hi,
    I am using CF 8
    I have a text file (mylog.txt) that currently stores login
    information for our users. I need to parse and extract some basic
    information from the file and I am having a hard time. I need to
    know the following
    1. A list of all UNIQUE email addresses that appear in the
    text file.
    2. A count of how many times each email address appears
    Each time a user logs on a "new line" is entered in the text
    file. Here is some sample data:
    [1/05/08 1:15:31 PM] User [email protected] logged in.
    [1/11/08 3:57:30 PM] User [email protected] logged in.
    [1/12/08 8:33:17 PM] User [email protected] logged in.
    [2/17/08 6:37:07 AM] User [email protected] logged in.
    [2/19/08 3:57:30 PM] User [email protected] logged in.
    I would like to parse the text file and then output my
    results to the screen. The output should look like this, note John
    logged in twice:
    Email Address | Count
    [email protected] 1
    [email protected] 2
    [email protected] 1
    [email protected] 1
    The prior user here should have stored this in the database
    but for now I still need to get at this data.
    Any help appreciated.
    Thanks,
    -Westside

    You can use cfhttp to convert your file variable to a query
    and use query of queries to count email adddresses.

  • I need help parsing a  swift data string

    i need to parse swift financial data
    is there a way to use split or stringtokenizer for ::
    and keep the :: as part of the new seperated data.
    i want to put each string starting with :: on a seperate line in a text box.
    i gave up and tried it with a loop and a stringbuffer , and indexof.
    if (line.indexOf("::") == Strpos ){
    frame.jTextArea1.append(displayline.toString());
    displayline = new StringBuffer();
    displayline.append(line.substring(Strpos, (Strpos + 2)));
    Strpos += 2;
    if (line.indexOf("::") != Strpos ) {
    displayline.append(line.substring(Strpos, Strpos + 1));
    System.out.println( displayline);
    Strpos++;
    but i cant get that to work either.
    if anyone knows how to parse swift data please give me your email address.
    i've been doing it in cobol for 15 yrs and i just cant get the cobol techniques to translate to java.
    thanks.

    as i said
    i am really a cobol guy
    and yes as you see i did try to use indexof in my code.
    but there must be something about indexof that i'm not getting.
    it works the first time in the loop but then as i increment my start position(strpos)
    the indsex of no longer works.
    am i using the correct technique to increment the start position thru the string buffer.
    thanks guys.

  • Need to parse Japanese Full Date Format

    Hi,
    Locale japanLocale = Locale.JAPAN;
    SimpleDateFormat fullDateFormat = (SimpleDateFormat) SimpleDateFormat.getDateTimeInstance(DateFormat.FULL, DateFormat.FULL, japanLocale);
    String dateValue = 2010'?'09'?'12'?' 1'?'15'?'45'?'GMT // Here Japanese character will come instead of ?
    DateFormat initialDateFormat = new SimpleDateFormat(fullPattern, japanLocale);
    Date date = initialDateFormat.parse(dateValue);
    String formattedDate = fullDateFormat.format(date);
    This throws Exception java.text.ParseException: Unparseable date: "2010'?'09'?'12'?' 1'?'15'
    ?'45'?'GMT"
    If you send some good suggestions, it will be appreciable.
    Thanks in Advance
    Suresh

    Japanese full pattern is:
    "yyyy'年'M'月'd'日' (EEEE)
    H'時'mm'分'ss'秒' z"
    I need to parse this string.
    OK:
    String pattern = "yyyy'年'M'月'd'日' (EEEE) H'時'mm'分'ss'秒' z";
    String date = "2004年8月12日 (木曜日) 13時56分01秒 EEST";
    SimpleDateFormat parser = new SimpleDateFormat(pattern, Locale.JAPAN);
    Date d = parser.parse(date);
    System.out.println(d); // prints Thu Aug 12 13:56:01 EEST 2004
    Note that for the sake of portability the two first lines should be written asString pattern = "yyyy'\u5e74'M'\u6708'd'\u65e5' (EEEE) H'\u6642'mm'\u5206'ss'\u79d2' z";
    String date = "2004\u5e748\u670812\u65e5 (\u6728\u66dc\u65e5) 13\u664256\u520601\u79d2 EEST";This is to make it possible to compile your code on a platform that doesn't support Japanese script.
    Can i have your Yahoo / AOL ID?What makes you think I have one? :)

  • I need to edit text in a jpeg file.  How do I do that?

    I need to edit text in a jpeg file.  How do I do that?

    Unfortunately you can't. A JPEG is a flat raster (pixel-based) image file which has no awareness of "text" inside it. You could try to erase the text and graphic under it and then recreate the text, but it's best to do so using a mastering format such as PSD (Photoshop) or PXM (Pixelmator), so that you can export as JPEG but keep your layered master for later editing.
    Matt

  • Need to enter text in boxes

    I have created number of boxes using vertical and horizontal lines. Now I want to position texts exactly in the box where it needs to be. I know that there are tabs but how do i position the y axis. I want  some texts to enter in the first line of the boxes and then on the second line. Let me know how to position them.

    Hello Ramesh,
    I have same issue....I had designed a box by using sy-uline and sy-vline.
    But, I need to enter text in 2 differrent lines...in that box.
    Here is the code : 
    SKIP TO LINE 1.
    ULINE AT 281(40).
    WRITE : /281 SY-VLINE, 282(41) 'Ventas Internas o Exportación Gravadas', 320 SY-VLINE.
    It is displaying properly in that box. BUt the requirement is I need to display the test in 2 diff lines as specified:
                     Ventas Internas o
                  Exportación Gravadas
    This trequirement is very urgent for me...any suggestions would be appreciated.
    Thank you
    Keats.

  • In InDesign, how does one determine the pixel size of a text box? Specifically, we need to write text to specifications of 600 pixel width, and have no idea a) how to scale a text box to specific pixel width, b) how to

    This may be a basic question... but in InDesign, how does one determine the pixel size of a text box? Specifically, we need to write text to specifications of 600 pixel width, and have no idea a) how to scale a text box to specific pixel width, b) how to determine what word count we can fit in, and c) how to do it in a table? Thanks!

    Set your ruler increments to pixels Preferences>Units & Increments. You can fill the text box with placeholder text Type>Fill with Placeholder text and get a word count from the Info panel with Show Options turned on from the flyout.
    From the Transform panel you can set a text box's width and height

  • Need to read text file content and have to display it in multiline text box

    dear all,
    Need to read text file content and have to display it in multiline text box.
    actually im new to file handling. i have tried up to get_line and put_line.
    in_file := TEXT_IO.FOPEN ('D:\SAMPLE.txt', 'r');
    TEXT_IO.GET_LINE (in_file,linebuf);
    i dont know how to assign this get_line function to text item
    pls help me in this regards,

    Simply write:
    in_file := TEXT_IO.FOPEN ('D:\SAMPLE.txt', 'r');
    TEXT_IO.GET_LINE (in_file,linebuf);
    :block2.t1 := chr(10)||:block2.t1||chr(10)||linebuf;
    chr(10) --> is for new line character

  • I am using Photoshop Elements 11 and I need to  convert text to curves

    I don't need to put text on a curve but need to convert the text of my picture to curves by the company that is going to re-produce it.  The require this so that the text won't get distorted if they don't have the same fonts that I am using.
    I can't find any info on how to do this, Can I convert whole words or do I have to do a letter at a time?  Can I get all the text on one layer and then convert the text on that layer to curves?
    Kat in Canada

    You can try below two options and see if it does what you want
    - Use Text on Path Tool. For more info refer
    http://help.adobe.com/en_US/photoshopelements/using/WS287f927bd30d4b1f-deece6d12e28b17def- 7fff.html#WS5b9a9ff298eb77cc-1da27bd8130558d3d3c-7ffe
    -Other option would be to use text warp. See this video related to this
    http://www.youtube.com/watch?v=jdW1Pl2gfks

  • Need Help Parsing JSON String using PLJSON

    Hello,
    I have JSON stored in a database field:
    --Query
    select data1 from table1 where id= 339207152427;
    --Results:
    [{"name":"Home"},{"code":"JPNWC74ZKW9"},{"start date":"01\/02\/2014"},{"person name":"hhh, RamS"}]
    I need to parse the above results into 3 fields in a separate table. For now, i'm just trying to parse the results using PLJSON, but am getting the ORA-20101: JSON Parser exception - no { start found error when running the following pl/sql block:
    declare
    VIN_JSON varchar2(4000);
    jsonObj json;
    listOfValues json_list;
    listElement json_value;
    begin
    select data1 into VIN_JSON from table1 where id= 339207152427;
    jsonObj := new json(VIN_JSON);
    listOfValues := jsonObj.get_values();
    for i in 1..listOfValues.count loop
    listElement := listOfValues.get(i);
    end loop;
    end;
    I believe my syntax is close, but was hoping for some further instruction.
    Thanks in advance!
    John

    I have no idea what you are trying to do or in what version so help, at this point, is not possible.
    Let's start with this:
    I need to parse the above results into 3 fields in a separate tableAnd the parsing rules?
    And what the result should be?
    You apparently want us to guess. Which is something most of us do not like to do. (and don't forget your full version number if you want help).
    PS: This forum has a FAQ: I recommend you read it as you didn't even put your listing into tags.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Parse Text-File into array

    Hi,
    I hava a text-file with a structure like this.
    "sfdgasdf" "sadsadsadf" "sadfsdfasfd"
    "qwevsdf" "sdgfasdfsafd" "yxvcyxvcyxvc"
    "hgfddfhhfdfdf" "ewrtqwrwqewqr" "dfgdgdgsdgsdfgsdgg"
    My aim is to read this text-file (*.txt) and parse it into an string-array (or whatever is the best). The contents between the apostrophes should be inserted in this array line by line.
    For example:
    array[0][0] = "sfdgasdf";
    array[0][1] = "sfdgasdf";
    array[0][1] = "sadfsdfasfd";
    array[1][1] = "qwevsdf";
    How can I achieve this?
    Thanks
    Jonny
    That's how far i came (not very far).
    File file = new File("c:\temp\text.txt");
    FileReader stream = new FileReader(file);

    Hi,
    still facing some problems.
    My text which I want to parse:
    "sfdgasdf" "sadsadsadf" "sadfsdfasfd"
    "qwevsdf" "sdgfasdfsafd" "yxvcyxvcyxvc"
    "hgfddfhhfdfdf" "ewrtqwrwqewqr" "dfgdgdgsdgsdfgsdgg"
    My code:
    String[] parse = text.split("\"");
    The array that is created has whitespaces and linebreaks as elements. I only want the characters in beween the apostrophes.
    How can I "tell" the split function not to insert them in my array?
    Cheers
    Jonny

  • HELP! Need help generating TEXT-ONLY portal page...

    Text Only Portal Question:
    PLATFORM:
    =================================================================
    Sun Solaris (5.2 if memory serves) for db and mid-tier, running
    8.1.7 DB and 3.0.9 (1.0.2.2) portal.
    THE NEED:
    =================================================================
    I need to display text only portal pages. Some of the more
    detailed concerns at this point are below. Also, I've had an open
    tar on Metalink for about two weeks, and after research from
    their end has resulted in no help.
    THE ISSUES (so far):
    =================================================================
    IMAGES:
    If an anchor [A HREF=...] tag uses an image as it's "text", I
    need to strip out the ALT= text to show inside the anchor. If no
    ALT text is available, then I would like to show the image name
    as a default.
    For example:
    <img src=home.gif
    alt=Home>
    should display as:
    Home
    FORMS:
    How do I get the resulting page from a form (which include the
    login inputs and submit button, search box, advanced search page,
    etc.) to be displayed by the text only page?
    For example:
    When a form is called, the <FORM> elements are as follows:
    METHOD=GET or POST
    ACTION=url (relative or absolute) to the script.
    In this case, the action value is:
    ACTION=/servlet/page?
    pageid=6&dad=portal30&_schema=PORTAL30.
    This calls the advanced search API.
    I would expect that to redirect the browser back to some
    text-only version, the ACTION= element would have to be changed
    to be something like:
    ACTION=[pathscraper]?/servlet/page?
    pageid=6&dad=portal30&_schema=PORTAL30
    REDIRECTION:
    What happens when portal pages redirect internally? How do you
    get back to the text-only page?
    For example:
    The login link on the standard Oracle Portal home page flips
    from url to url to get to the actual login page. Our
    implementation of Oracle portal goes from
    [DOMAIN]/pls/portal30_sso/portal30_sso.wwsso_app_admin.ls_login
    to [domain]/pls/portal30_sso/portal30_sso.login_page.
    Since this is standard Oracle redirection, how can it be
    intercepted so the portal30_sso.login_page can be presented as
    text only?
    TRIED SO FAR:
    =================================================================
    I've written a socket/text scraper in Perl, running it from a web
    server. The problems mentioned above are really causing problems,
    plus the whole cookie thing. Since Oracle Portal tries to push a
    cookie to the client, when the client is another UNIX server,
    the cookie thing doesn't work.
    POSSIBLE OTHER SOLUTIONS:
    =================================================================
    Something...anything. I've tried to think of some method to
    create some sort of PL/SQL procedure to catch the content then
    strip out the HTML calls.
    An Applet to do the same thing, but on the client side, but
    since time is an issue, coding a complete Java applet isn't
    really an option.
    THE CONCLUSION:
    =================================================================
    HELP! I need some help. This is for a client that is government
    funded, and to meet Section 508 (part of the Americans with
    Disabilities Act that states web sites and applications must be
    made accessible. A text-only page is one of the requirements for
    an accessible page.
    Thanks,
    Ryan Stefani
    ps: feel free to contact me via [email protected] or
    [email protected]

    Use Find/Change and the GREP tab.
    Search for .+ and set the Find formatting to find the charcteristics you want.
    What will you do with this text once found? You'll need something to "change" to, either new text or Change Formatting options...

  • Can someone tell me what settings I need for ipad texting.  Went to Mexico and now can't get the texting to work at all on ipad.  Thanls

    Can someone tell me what settings I need for ipad texting.  I went to Mexico and when I returned the texting does not work on my ipad.  The support at Apple wanted to charge me to get info.
    THanks

    Can't address the problem directly, cause even though my iPad4 is Cell+Wi-Fi, I've never put a SIM in it and never had the need to text, SMS or iMessage, from it. When away from the office or home wireless network, I tether it off the iPhone. Skype, both text and video, work just fine thru the Wi-Fi link, though.
    HOWEVER, when I was hashing out the contract details to get the iPhone 5 about 14 months ago at Telcel, the representative distinctly mentioned that both Visual Voicemail as well as iMessages would be included in the package and they would be mandatory cause "I was getting a (subsidized) Apple iPhone" on a 24 month leash. Then when the gizmo came out of its box for SIM installation and activation, she went thru the motions of making sure both were working properly.  So I assume the carrier has some say in the matter.

  • Need to rotate text 90 degrees in Numbers...any hints?

    Need to rotate text 90 degrees in Numbers...any hints?

    If you mean rotate text in a cell then this discussion may help with ideas to coerce Numbers to do what you want when it does not have the capability:
    https://discussions.apple.com/message/17454065#17454065

  • Parsing text for keywords

    Hi there, i'm about to start a project where i analyse text and pick out all of the meaningful words, throwing away the determiners (such as "the", "a", "an" etc...).
    I realise that i could compare my String to a whole list of these words, but i was wondering if anybody had any suggestions before i start. Is there a package that would save me the trouble of writing out a long list of words, or even any sample code. I'm googling as we speak but just thought i would ask here as well.
    Thanks in advance
    oookiezooo

    yeah, i already have alot of knowledge of parsing text, but frankly the idea of writing a HUGE list of words i don't want to include doesn't appeal to me, thats why i asked, thanks for trying though!

Maybe you are looking for

  • LiveCycle Designer ES Not Working-Acrobat 9

    I am using an older version of LiveCycle and Acrobat to create forms.. ES8.2; however, it has stopped working.  When I go to create or edit a form, it will not launch the form and states there is problem. (see below).  Can someone let me know how to

  • Plz help in resolving the error

    hai experts, i just craeted a demo webdynpro application and when i run it i got the following error. can someone help me in sorting out this one. the error is as follows: The following error text was processed in the system ECD : An exception occurr

  • Viewing thumbnail in Windows Explorer

    On my desktop PC running Vista, in Windows Explorer I get a thumbnail showing the content of a pdf file.  On my laptop running Windows 8.1, I only get an icon with the pdf logo.  Is it possible to get the thumbnail view in 8.1?  If so, how?

  • Fill bucket- too much fill

    when i select an area with whichever selection tool (in this case i used the magic wand), then i proceed to use the fill bucket to fill the selected area with a different color, the area becomes filled with the new color, however it also some extra p

  • Applescript keeps stopping for user interaction

    I use this great applescript for turning my indesign layers into photoshop layers: http://www.zenodesign.com/scripts/PagestoPSLayers.zip It asks for a folder to put a temporary pdf, then asks some preferences (indesing pdf export preset, color mode,