Need to turn this lastName_Name_01_07_1980.xml into  Name LastName 01.07.80

Hi all
I am using this code to trim a string and place it into a jMenu. Now I would like to change the out the way is looks to make it easier to view.
Like this:
Need to turn this file name lastName_FirstName_01_07_1980.xml into FirstName LastName 01.07.80
is this posible to do ?
can some me how ?
  private void addItem(JMenu menu, char a)
  File dir = new File("Epod Configuration/Orders To Upload");
        File[] files = dir.listFiles();
        for (int j=0; j < files.length; j++)
                String trim = ""+files[j];
                int ndx;
                if ((ndx = trim.lastIndexOf('/')) != -1) trim = trim.substring(ndx+1);
                if (trim.charAt(0) == a)
                  System.out.println(trim);
                        JMenuItem mi = new JMenuItem(trim);
                        menu.add(mi);
  }Thanks
Craig

thanks for that
but how do I put the two codes together ??
the file name also has .xml at the end what is the bet way of getting rid of that
this is what I have try but doesn't work
Please help
private void addItem(JMenu menu, char a)
    File dir = new File("Epod Configuration/Orders To Upload");
    File[] files = dir.listFiles();
    for (int j=0; j < files.length; j++)
      String trim = ""+files[j];
      int ndx;
      if ((ndx = trim.lastIndexOf('/')) != -1) trim = trim.substring(ndx+1);
      if (trim.charAt(0) == a)
        System.out.println(trim);
        String s = "lastName_FirstName_01_07_1980";
        StringTokenizer st = new StringTokenizer(s, "_");
        String last = st.nextToken();
        String first = st.nextToken();
        String month = st.nextToken();
        String day = st.nextToken();
        String year = st.nextToken();
        System.out.println(first + ' ' + last + ' ' + month + '.' + day + '.' + year);
        JMenuItem mi = new JMenuItem(trim);
        menu.add(mi);
  }

Similar Messages

  • I need to turn an indesign document into an editable pdf. how do I do that?

    I need to turn an indesign document into an editable pdf, how do I do that?

    InCopy is a solution, but it's not the only viable solution.
    I update many books, from 200 pages to 3,200 pages every year, long document, very techincal tax books.
    Some are done through InCopy, some are edited word files and rtfs exported from InDesign, some are marked up hard copies etc.
    It totally depends on the clients technical ability with computers. Last year I taught over 30 authors of ours how to use InCopy. Some were receptive, some were dubious, some were totally clueless.
    And on the dubious and totally clueless I spent more time troubleshooting their problems than I would normally with a Word/RTF option.
    Some people are capable of switching to InCopy or even know how to use it in the first place. For anyone never used InDesign or InCopy before then it's a massive learning curve to jump from MS Word et al word processors, to InCopy.
    I do agree, it is the best solution that's out there, technically. But that solution is not usable by a lot of people.
    Yeh if the client is comfortable with InCopy then it's the way forward.
    But in most cases, in my experience, it's faster and more efficient to Export the text as RTF and let the author update the RTF. That leaves you in control of reinserting the text and formatting it correctly. Rather than letting the client add bold, underline, italics, superscript, subscripts, crazy workarounds because they didn't know how to do it properly. And in the end you end up with 2 or 3 times the amount of work than is necessary, just cleaning up what the client has done in InCopy that does not suit the overall formatting of the publications.

  • I am working on a book in the book module of Lightroom. When I started, I didn't realize that there was a limit of 240 pages. I am going to need to break this book up into two books now. Is there anyway to move pages from one book and create a new book wi

    I am working on a book in the book module of Lightroom. When I started, I didn't realize that there was a page limit of 240 pages. I am going to need to break this book up into two books now. Is there a way to take pages from one book to start a second book without having to "redo" the pages again in the new book?

  • Need to turn this PLSQL into a procedure

    Hi All,
    I have the following PLSQL which declares a cursor, then loops using the cursor variable. I'm new to creating procedures and packages and i'm having trouble turning this PLSQL into one of those. When i put my PLSQL code in a procedure it doesn't like the DECLARE statement or the CURSOR section. I'm not sure how to tweak it to get the syntax correct for a procedure. Can someone point me in the right direction?
    Here is the PLSQL:
    DECLARE
    /* Output variables to hold the result of the query: */
    groupid assignment_group.id%TYPE;
    /* Cursor declaration: */
    CURSOR Asset_Rank_HistoryCursor IS
    select distinct id from assignment_group;
    BEGIN
    OPEN Asset_Rank_HistoryCursor;
    LOOP
    /* Retrieve each row of the result of the above query into PL/SQL variables: */
    FETCH Asset_Rank_HistoryCursor INTO groupid;
    /* If there are no more rows to fetch, exit the loop: */
    EXIT WHEN Asset_Rank_HistoryCursor%NOTFOUND;
    /* Insert the the new rows */
    insert into ASSET_RANK_GROUPED (asset_id , dt, rank, score, ASSIGNMENT_GROUP_ID)
    select asset_id, max_dt, rownum, score, groupid from (
    SELECT <big nasty select statement>
    END LOOP;
    /* Free cursor used by the query. */
    CLOSE Asset_Rank_HistoryCursor;
    END;
    How do i change my DECLARE and CURSOR statement so the procedure will create. Do i need to break it out into a function?

    I figured it out... just had to play w/ the syntax. Had to make sure the BEGIN statement was AFTER the CURSOR declaration and had to make sure any variables are declared up top, didn't need a DECLARE section in procedure. I just put the groupid variable right after IS at the top of procedure creation statement.

  • [F8]Need to turn this gallery into a slide show

    I have some code from a "how to" used to create a photo
    gallery. This gallery was meant to be used with buttons but, what I
    need is for the images to fade in and out automatically. Not sure
    what code would allow that to happen.
    Im using this type of gallery becuase I will have approx 300
    images to fade in and out. I plan on having four of these objects
    on the stage running at the same time.
    Here is the code I am working with:
    //Code written by sbeener (suprabeener)
    i wrote this code, but you can use and abuse it however you
    like.
    the methods are defined in the order which they occur to
    make it
    easier to understand.
    // variables ------------------------------------------
    // put the path to your pics here, include the slashes (ie.
    "pics/")
    // leave it blank if they're in the same directory
    this.pathToPics = "";
    // fill this array with your pics
    this.pArray = ["small8-05-1.jpg", "small8-05-2.jpg",
    "small8-05-3.jpg", "small8-05-4.jpg", "small8-05-5.jpg",
    "small8-05-6.jpg", "small8-05-7.jpg", "small8-05-8.jpg",
    "small8-05-9.jpg",
    "small8-05-10.jpg","small8-05-11.jpg","small12-22-05-12.jpg","small12-22-05-13.jpg","smal l12-22-05-14.jpg","small12-22-05-15.jpg","small12-22-05-16.jpg","small12-22-05-17.jpg","sm all12-22-05-18.jpg","smallCommonEntrance-19.jpg"];
    this.fadeSpeed = 50;
    this.pIndex = 0;
    // MovieClip methods ----------------------------------
    // d=direction; should 1 or -1 but can be any number
    //loads an image automatically when you run animation
    loadMovie(this.pathToPics+this.pArray[0], _root.photo);
    MovieClip.prototype.changePhoto = function(d) {
    // make sure pIndex falls within pArray.length
    this.pIndex = (this.pIndex+d)%this.pArray.length;
    if (this.pIndex<0) {
    this.pIndex += this.pArray.length;
    this.onEnterFrame = fadeOut;
    MovieClip.prototype.fadeOut = function() {
    if (this.photo._alpha>this.fadeSpeed) {
    this.photo._alpha -= this.fadeSpeed;
    } else {
    this.loadPhoto();
    MovieClip.prototype.loadPhoto = function() {
    // specify the movieclip to load images into
    var p = _root.photo;
    p._alpha = 0;
    p.loadMovie(this.pathToPics+this.pArray[this.pIndex]);
    this.onEnterFrame = loadMeter;
    MovieClip.prototype.loadMeter = function() {
    var i, l, t;
    l = this.photo.getBytesLoaded();
    t = this.photo.getBytesTotal();
    if (t>0 && t == l) {
    this.onEnterFrame = fadeIn;
    } else {
    trace(l/t);
    MovieClip.prototype.fadeIn = function() {
    if (this.photo._alpha<100-this.fadeSpeed) {
    this.photo._alpha += this.fadeSpeed;
    } else {
    this.photo._alpha = 100;
    this.onEnterFrame = null;
    // Actions -----------------------------------------
    // these aren't necessary, just an example implementation
    this.onKeyDown = function() {
    if (Key.getCode() == Key.LEFT) {
    this.changePhoto(-1);
    } else if (Key.getCode() == Key.RIGHT) {
    this.changePhoto(1);
    Key.addListener(this);

    I figured it out... just had to play w/ the syntax. Had to make sure the BEGIN statement was AFTER the CURSOR declaration and had to make sure any variables are declared up top, didn't need a DECLARE section in procedure. I just put the groupid variable right after IS at the top of procedure creation statement.

  • HELP NEEDED!!!displaying xml node name in an input text box

    Hello everybody
    Have a simple proble. I have imported an XML file into flash
    using the Tree component and the XML_conn component. So i have the
    xml tree displying in flash when i have run it.
    I have created an input text box called 'subject'
    All i really need is when a user clicks on any node for that
    node name to be displayed in a the input text box. thats it. ITS
    DRIVING ME CRAZY

    Try something like this. (if your Tree is called myTree)
    var myTreeListener = {}
    myTreeListener.change = function(evtObj) {
    subject.text = evtObj.target.selectedNode.nodeName;
    myTree.addEventListener("change",myTreeListener)

  • Need to Parse or Read XML into a ResultSet

    Hi, I see lots of examples of folks reading from a database, populating a ResultSet, and then putting that data into an XML document. I don't see any reference to going the other way, and was hoping some of you might have an insight on how to do this.
    We have a huge historical database and want to take the older info, put it into xml format, zip it, and store the zip'd result as a blob. That's the easy part.
    We want to be able to go back, to read the blob, unzip it, and then populate a ResultSet and return that to the caller. I don't see any slick methodology to either 1.) instantiate an empty ResultSet or 2.) parse/read an XML structure into a ResultSet.
    Any bright ideas?
    Thanks, John

    @maggie: That is easily done with XPath expressions, for example:
    xmlstarlet sel -t -m '//servers[@country_code="us"]' -c '.' -n vpn.xml
    xmlstarlet sel -T -t -m '//servers[@country_code="us"]' -v @public_name -o " " -v @bw -n vpn.xml
    xmlstarlet sel -t -m '//servers[@country_code="us"]' -v '@public_name' -o ": " -v '@currentload' -n vpn.xml
    xmlstarlet sel -t -m '//servers[@country_code="us" and @currentload<15]' -v '@public_name' -o ": " -v '@currentload' -n vpn.xml
    xmlstarlet sel -t -m '//servers[@currentload<15]' -v '@public_name' -o ": " -v '@currentload' -n vpn.xml
    http://www.w3schools.com/xpath/default.asp
    Edit: If you use json and jshon, then you'll have to do the sorting and filtering in the shell
    jshon -e servers -a -e country_code -u -p -e public_name -u -p -e bw -u <vpn.json | {
    # filter country_code
    while read -r country_code && read -r public_name && read -r bw; do
    [ x"$country_code" = x"ca" ] && echo "$public_name $bw";
    done
    } | sort -k2,2nr -k1,1d # sort second field (bw) numeric reverse, if equal use dictionary sort on first (name)
    Last edited by progandy (2015-05-31 05:47:50)

  • Need help converting this html code into code that will work as a flash button

    I have some html code that is for a button in html that when
    pressed sends you to a certain url but also somehow adds an 'id
    value' and a 'website value'.
    How can I convert this code and or put it into a flash
    button?
    Disregard the gif info...that's just for the html graphic
    that goes for the button.
    [HTML]<form
    action="https://secure.verotel.com/cgi-bin/vtjp.pl"
    method="post">
    <input type=hidden name=verotel_id
    value="9804000000840231">
    <input type=hidden name=verotel_website value="55461">
    <center>
    <input type="image" src="
    http://buttons.verotel.com/join/button_00010155461.gif"
    alt="Signup NOW!">
    <img src="
    http://buttons.verotel.com/signup/tbutton_55461.gif"
    border="0" width="1" height="1" alt="">
    </center>
    </form>[/HTML]

    What you want to do might look something like this:

  • How to restore this kinda XML into an array or list?

    I have a XML file like this
    [msgboard]
    [message]
    [subject] subject [/subject]
    [body] text body [/body]
    [followups]
        [message]
            [subject] subject [/subject]
            [body] text body [/body]
            [followups]
                       [message] ...
            [/followups]
        [/message]
    [followups]
    [/message]
    [/msgboard]so the XML can be unlimited deap.
    I want to read it into an array or list or something like that, so I can use the data.. but how should I store them? any ideas ? thanks

    Please refrain from cross posting http://forum.java.sun.com/thread.jspa?threadID=785000

  • I need to turn a print pdf into a web ad

    I have created pdf's for a print project.  I need to know how to convert the pdf's into web ads.  I have InDesign CC and Adobe Photoshop CS2.
    Any help would be appreciated!
    Thanks,

    You'll probably be using still images or GIF animation for final ad; another option is Flash (SWF).  Digital ad agencies sometimes require multiple file versions for expandable ads - still image, collapsed state, expanded state. Per post above, Photoshop will be sufficient to create basic stills, if you're doing animated ads you might need to get someone to help you.

  • I have an ASUS p550C with pinch zoom on the track pad that is driving me nuts. I need to turn this off!

    pinch zoom needs to go away on this laptop running windows 7

    You can set involved <b>browser.gesture</b> prefs to an empty string on the <b>about:config</b> page.
    You can open the <b>about:config</b> page via the location/address bar.
    You can accept the warning and click "I'll be careful" to continue.
    *http://kb.mozillazine.org/about:config

  • How can I turn this line and its intersection into a separate object?

    My initial object is #1, then I draw a line on #2.
    How can I turn the highlighted area into a separate object? (I cheated and filled this area with Photoshop, but I'd like to know how to turn this red area into a separate object so that I can fill it with Illustrator)
    Thanks in advance

    Alex,
    Or you may just Pathfinder>Divide and Ungroup.

  • Extract part of xml into CLOB or XMLType

    I need to extract part of XML into CLOB or some another type. But I don't need only extract data, by whole part od xml with elements. How could I do it in PL/SQL?
    For example from this xml:
    <bookstore>
    <book category="COOKING">
    <title lang="en">Everyday Italian</title>
    <author>Giada De Laurentiis</author>
    <year>2005</year>
    <price>30.00</price>
    </book>
    <book category="CHILDREN">
    <title lang="en">Harry Potter</title>
    <author>J K. Rowling</author>
    <year>2005</year>
    <price>29.99</price>
    </book>
    </bookstore>
    I need to get:
    "<book category="COOKING">
    <title lang="en">Everyday Italian</title>
    <author>Giada De Laurentiis</author>
    <year>2005</year>
    <price>30.00</price>
    </book>"
    THX

    That's why I need to process every book alone - to know which authors belongs to single book.For that specific requirement, a single query would do.
    Assuming variable "v_xml_clob" holds the XML document :
    <bookstore>
      <name>nameOfBookstore</name>
      <address>1st Avenue 24, SF</address>
          <book category="COOKING">
            <title lang="en">Everyday Italian</title>
            <author>
              <name>Giada De Laurentiis</name>
              <birth>1956</birth>
            </author>
            <author>
              <name>xxx</name>
              <birth>1955</birth>
            </author>
            <year>2005</year>
            <price>30.00</price>
          </book>
          <book category="CHILDREN">
            <title lang="en">Harry Potter</title>
            <author>
              <name>Rowning</name>
              <birth>1977</birth>
            </author>
            <author>
              <name>xxx</name>
              <birth>1955</birth>
            </author>
            <year>2005</year>
            <price>29.99</price>
          </book>
    </bookstore>You can do :
    SELECT *
    FROM XMLTable(
    'for $i in distinct-values($d//book/author/name)
      where count($d//book/author[name=$i]) = 1
      return $i'
    passing xmltype(v_xml_clob) as "d"
    columns author_name varchar2(80) path '.'
    AUTHOR_NAME
    Rowning
    Giada De Laurentiis

  • Turn my Sub-Account into Primary Account

    Guys,
    Looking for some help as i can't get anywhere with online chat and even after speaking to someone over the phone who advised it would be resolved in 24hrs, i got an annoying text that i could not reply to stating it couldn't be done.
    Basically a btinternet e-mail address that i have used for years is classed as as Sub-Account.  I have been trying to set up BT WIFI but when i use this e-mail address it says that it is not a primary account - i do know the primary e-mail address but since i never use that i would prefer to have just the one.
    So i need to turn my Sub-Account into my Primary Account.
    I was advised this could be done, gave them all the details, told it would be sorted in 24hrs time.  72hrs later i received a text message "We have tried to contact you but were unsuccessful, unfortunately the e-mail address you have requested is already in use"
    Two things here, i've no missed calls or voicemails so i find it hard to believe they tried to call me, secondly i know that the e-mail address is already in use...because it is me that uses it! I just need it set to my primary...
    How difficult can this be? Customer Service is really poor, several issues over the past 6months that i end up spending hours explaining a 2minute problem, i guess this is what happens when you offshore service desks and expect people to use basic transcripts to resolve a clear language barrier.
    Solved!
    Go to Solution.

    Hi Bartram1990,
    Welcome to the forum and thanks for the post.  I am sorry to hear your request has not been carried out.  This is something that I will be able to do for you.
    Please drop me an email.  Click on my username (SeanD) and you will find the 'Mods contact link' under the 'About me' section of my profile.  Please include your account details and the email address in question.  Once I have this info I will be able to sort this out.
    Cheers
    Sean
    BTCare Community Manager
    If we have asked you to email us with your details, please make sure you are logged in to the forum, otherwise you will not be able to see our ‘Contact Us’ link within our profiles.
    We are sorry that we are unable to deal with service/account queries via the private message(PM) function so please don't PM your account info, we need to deal with this via our email account :-)

  • Convert MBox into XML into Java Objects

    Hello all,
    this is a general question, i dont know weather there is such libs or not.
    However, please tell me what you know.
    i want to program a java application for searching purpose in Mbox.
    i thought its possible and easier to try to convert the emails from the MBox into XML files, and from these create java objects when i need or even convert the XML into html for viewing.
    Any suggestions are welcome.
    Also antoher solutions are greate.
    thanks in advance!
    Sako.

    I don't know what this MBox you speak of is - I assume it's not the thing I use to hook upa guitar to GarageBand. Maybe you mean it as a generic term for mailbox? The easiest solution (to my mind) would be to use a Java API provided by whatever MBox is. If there is no such thing, then if you get XML-formatted version of the messages I suppose writing code to parse the XML into Java Objects would be a good option if you wanted to do further manipulation of them, but if all you want to do is display them as HTML in a browser then just use XSLT to transform them.
    Good Luck
    Lee

Maybe you are looking for

  • Samsun SCH-LC11 4G Hotspot SLOW!

    Got mine today.  Luckily, I don't deal with VPN much which they apparently have screwed up (http://community.vzw.com/t5/4G-Discussion/Samsung-SCH-LC11-Blocks-Microsoft-VPN/td-p/489618), something about this being a Home device not a Business Device ?

  • Problem with to_date('date_char') in a where clause

    A little confused with this plsql error. This code works... select to_date(value,'dd/mm/yy') from kip_lov where domain='MODULE START1' If I try to put the "to_date(value,'dd/mm/yy')" expression in the where clause I get an invalid year error, select

  • Need help in Hide IP Program

    Hi all: I want to create a program in Java Scribt that help me to hide my Ip , my question is how can I begin to create this program & in which product of java can I do it >>><<<< regards

  • HELP !! Urgent !! Object in contexts

    Hello, I have really urgent task to do. I need have access to object kept in <input type="file"> object. Is it possible to get the object without submitting the form ?? I suppose that page has to hold the object somewhere but have no idea how to acce

  • Scripts-background image

    Hi..,      How can i insert the image as Background for a page. When I search in SCN..   I saw                                          select page node--> three tabs                                                                attributes