Sorting problem PLZ Hellp Me

hi all
i had a problem to be solved but i am unable to get any idea on it
my problem is
i had some directiories with names as MONYEAR
i.e JAN2004,SEP2004,AUG2004 ,JUL2004 etc.............
these dirs are created programetically for storing that perticular months files in that dir only
now my problem is
i wan to dislay these DIRs in a sorted order according to MONYEAR order ie JAN2004,JUL2004,AUG2004,SEP2004 like that
i had no idea how to do it in a simple way
i was new to java
anybody could PLZ help me how to do it
if so plz provide me some sample code
thanks all

here's a 'novel' approach
import java.util.*;
import java.text.SimpleDateFormat;
class FolderDateSort
  public FolderDateSort()
    ArrayList folderName = new ArrayList(Arrays.asList(new String[]{
      "MAR2004","JAN2004","AUG2004","DEC2004","FEB2004","MAR2003","SEP2004"}));
    Comparator comp = new MyComparator();
    Collections.sort(folderName,comp);
    for(int x = 0; x < folderName.size(); x++)System.out.println(folderName.get(x));
  public static void main(String[] args){new FolderDateSort();}
class MyComparator implements Comparator
  public int compare(Object o1, Object o2)
    SimpleDateFormat sdf1 = new SimpleDateFormat("MMMyyyy");
    SimpleDateFormat sdf2 = new SimpleDateFormat("yyyyMM");
    Calendar cal1 = Calendar.getInstance();
    Calendar cal2 = Calendar.getInstance();
    try
      cal1.setTime(sdf1.parse((String)o1));
      cal2.setTime(sdf1.parse((String)o2));
    catch(Exception e){e.printStackTrace();}
    return (sdf2.format(cal1.getTime())).compareTo(sdf2.format(cal2.getTime()));
}

Similar Messages

  • I'm unable connect my I pad mini to my laptop(window 7,64 bit) after formatting,my iTunes didn't find my device,before format everything working properly but this time lot of problem plz help

    I'm unable connect my I pad mini to my laptop(window 7,64 bit) after formatting,my iTunes didn't find my device,before format everything working properly but this time lot of problem plz help

    You formatted your computer's hard drive? If so, it's like starting with a new computer unless you restored all of your content from a backup but it does;t sound like that's the case.
    See wjosten's excellent how-to here: Syncing to a "New" Computer or replacing a "crashed" Hard Drive

  • Sorting Problem in FND_MENU_ENTRIES_TL Table

    Hi,
    FND_MENU_ENTRIES_TL Table storing the record FND_MENU_ENTRIES_TL_N1(MENU_ID,PROMPT,LANGUAGE) wise in R12. But whereas in 11i, records stored FND_MENU_ENTRIES_TL_U1(MENU_ID,ENTRY_SEQUENCE,LANGUAGE).
    I am confused, whether i need to recreate the index in R12, so the records will get store MENU_ID,ENTRY_SEQUENCE,LANGUAGE wise.
    Could any one please suggest me how to resolve this problem.
    Thanks,
    Praba T

    815667 wrote:
    Hi,
    FND_MENU_ENTRIES_TL Table storing the record FND_MENU_ENTRIES_TL_N1(MENU_ID,PROMPT,LANGUAGE) wise in R12. But whereas in 11i, records stored FND_MENU_ENTRIES_TL_U1(MENU_ID,ENTRY_SEQUENCE,LANGUAGE).
    I am confused, whether i need to recreate the index in R12, so the records will get store MENU_ID,ENTRY_SEQUENCE,LANGUAGE wise.
    Could any one please suggest me how to resolve this problem.
    Thanks,
    Praba TPl do not abuse the forums by cross-posting in multiple forums
    Sorting Problem in FND_MENU_ENTRIES_TL Table
    Sorting Problem in FND_MENU_ENTRIES_TL Table
    Your issue is related to EBS, not to database upgrades (which is the topic of this forum)
    Srini

  • Sorting problems in Grid View

    Hi, I'm having a bit of a sorting problem when it comes to an artist with name variations. The example I'm going to use is DJ Tiesto.
    There are album I have where he is credited as DJ Tiesto, and others where he is simply Tiesto.
    In the end, I'd like these albums sorted chronologically under one name (say DJ Tiesto), while still preserving and showing the proper artist name for each album. I have it set to sort by "Album by Year", which is working fine.
    The major problem I am having is that I can't get it to display properly across all iTunes viewing methods: List mode, Grid mode, and Coverflow.
    I've tried leaving the Artist field alone, and changing the Sort Artist field to "DJ Tiesto" for all songs, and that almost works:
    -List mode groups them all under "DJ Tiesto", while showing each albums Artist as the correct artist name.
    -Grid mode sorted by Album groups them all under "DJ Tiesto", while showing each albums Artist as the correct artist name.
    -Coverflow sorts them all in chronological order, while showing each albums Artist as the correct artist name.
    Problem is, Grid mode sorted by ARTIST creates two separate artists! Some for DJ Tiesto and some for Tiesto!
    To correct this I tried changing the Album Artist field for all songs to "DJ Tiesto", which solved that problem but created a bunch of new ones:
    -List mode is still correctly grouping them under "DJ Tiesto", while showing each albums Artist as the correct artist name.
    -Grid mode sorted by Album is still correctly grouping them under "DJ Tiesto", *however now it is not displaying the correct Artist name for each album!*
    -Grid mode sorted by Artist is now grouping them all under "DJ Tiesto", *however it is not displaying the correct Artist name for each album!*
    -Coverflow is sorting them in correct chronological order, *however it as well is not displaying the correct Artist name for each album!*
    Using the Album Artist tag has created more problems that it has solved! Is there anyone who knows a way to achieve what I am trying to do? I have tried seemingly every option I can and have still not found a way to do this!!
    Thanks!

    My own method of working involves renaming the files upon import to:
    i "shotdate_sequencenumber"
    Files are therefore typically named
    b 2007-11-25_001
    etc.
    This way, sorting by Filename automatically sorts by Date by default. And it wouldn't even matter if you added a descriptive text in between the date and number (
    b 2007-11-25_Scotland_001

  • Sorting problem in standard vendor search help

    Hi all,
    I'm enhancing the vendor search help.
    I found that there is a sorting problem in the original standard search help.
    The 1st time to search vendor in the search help returns a correct list, then I just sort the vendor in ascending order. This time the column name of the hit list changes and mismatch the actual values.
    Any one faced this problem before?
    What's wrong are there ?
    Thanks.

    Thanks Peluka.
    But even I don't enhance the vendor search help, I still found that the original standard version has this problem after sorting.
    Is that the program bug?
    Have anyone encountered this problem before?

  • Hi i got a mac mini but when i connect it to my smartax mt882 modem via ethernet it says device not connected can anyone solve this issue it work fine with the usb connection but the ethernet is giving me problems plz help

    hi i got a mac mini but when i connect it to my smartax mt882 modem via ethernet it says device not connected can anyone solve this issue it work fine with the usb connection but the ethernet is giving me problems plz help

    Hello, give this a try...
    Make a New Location, Using network locations in Mac OS X ...
    http://support.apple.com/kb/HT2712
    10.5, 10.6, 10.7 & 10.8…
    System Preferences>Network, top of window>Locations>Edit Locations, little plus icon, give it a name.
    10.5.x/10.6.x/10.7.x/10.8.x instructions...
    System Preferences>Network, click on the little gear at the bottom next to the + & - icons, (unlock lock first if locked), choose Set Service Order.
    The interface that connects to the Internet should be dragged to the top of the list.
    For 10.5/10.6/10.7/10.8, System Preferences>Network, unlock the lock if need be, highlight the Interface you use to connect to Internet, click on the advanced button, click on the DNS tab, click on the little plus icon, then add these numbers...
    208.67.222.222
    208.67.220.220
    (There may be better or faster DNS numbers in your area, but these should be a good test).
    Click OK.

  • Hi! every one  ... i mine phone ettings cant be restore  its ask passcode am enter mine present mine old all passcode but they cant work  . if any one know solution mine problem plz rply . thanks regards

    hi! every one  ... imine phone settings cant be restore  its ask passcode am enter mine present mine old all passcode but they cant work  . if any one know solution mine problem plz rply . thanks regards

    Locked Out, Forgot Lock or Restrictions Passcode, or Need to Restore Your Device: Several Alternative Solutions
    1. iOS- Forgotten passcode or device disabled after entering wrong passcode
    2. iPhone, iPad, iPod touch: Wrong passcode results in red disabled screen
    3. Restoring iPod touch after forgotten passcode
    4. What to Do If You've Forgotten Your iPhone's Passcode
    5. iOS- Understanding passcodes
    6. iTunes 10 for Mac- Update and restore software on iPod, iPhone, or iPad
    7. iOS - Unable to update or restore
    Forgotten Restrictions Passcode Help
                iPad,iPod,iPod Touch Recovery Mode
    You will need to restore your device as New to remove a Restrictions passcode. Go through the normal process to restore your device, but when you see the options to restore as New or from a backup, be sure to choose New.
    You can restore from a backup if you have one from BEFORE you set the restrictions passcode.
    Also, see iTunes- Restoring iOS software.

  • Audio Clip problem plz help..

    There is some problem with my code. It is actually for simply playing a wav file.
    It gives errors on two lines....
    import java.awt.*;
    import java.awt.event.*;
    import java.io.*;
    import javax.swing.*;
    public class MediaPlayerDemo extends JFrame
         AudioClip clip; //Error Here
         public MediaPlayerDemo(String title)
              super(title);
         clip = getAudioClip(getCodeBase(),"access.wav"); //Error Here
         clip.loop();
         public static void main(String args[])
              MediaPlayerDemo m = new MediaPlayerDemo("Title");
              m.setSize(400,400);
              m.setVisible(true);
    }

    "Audio Clip problem plz help"
    You have to learn to help yourself.
    Have you done anything to try to fix the errors yourself?
    AudioClip clip; //Error Here
    the error generated here is self-explanatory.
    if you can't fix this, you should get a good book on java basics and start again.
    the other error is also easy to fix.

  • Classpath problem plz help me

    hi!
    i am unable to run my RMI server program .Name of My server class is SumServer.java,it implements SumInterface.java all the files(.class,.java and stub) are at location c:\javaprog\rmi\sum.
    I have not put them in any package.
    value of classpath is
    classpath=c:\jdk1.4\lib;.;c:\javaprog\rmi\sum
    i go in sum folder and run the program
    c:\javaprog\rmi\sum > SumServer
    it gives me following exception.plz help me out.
    Thx in advance.
    Exception occur.Unable to register serverjava.rmi.ServerException: RemoteExcepti
    on occurred in server thread; nested exception is:
    java.rmi.UnmarshalException: error unmarshalling arguments; nested excep
    tion is:
    java.lang.ClassNotFoundException: SumServer_Stub

    Deepa lakshmi wrote:
    Hi,
    Am new to weblogic.
    Am using the tools are,
    Weblogic8.1 version
    MySql5.0,mysql-connector-java-3.1.12-bin.jar file
    While test configuration of connection pooling am getting the error is "JDBC Driver is not on the classpath".
    How can i solve this problem
    plz help me
    regards
    DeepaEdit the start-weblogic script. Near the bottom, you will see
    lines that create a CLASSPATH for the weblogic server. Add a
    script line that adds the mysql driver to the classpath there.
    Joe

  • Ipod Sorting Problem!!!! PLZ HELP

    Before my ipod use to display artists from 1,2,3 to Z
    but now it displayes them from A-Z Then 1,2,3
    this is really bothering me.. how do i fix this?
      Windows XP  

    I believe this is a result of the new iTunes 7.3 software. I am going to try to uninstall this than reinstall the old version 7.2.something, perhaps that will help.

  • Sorting problem in smart form

    Hi,
    Good day guys
    Ive dev the smart form for workshop invoice..  everything fine but they need sort the stracture one which is LBBIL_IT_GEN.
    so ive created the custome stracture ZLBBIL_IT_GEN and added the numaric field at end of the strc.
    move-corresponding gs_it_gen to ZLBBIL_IT_GEN1.
    lv_num = lv_num + 001.
    ZLBBIL_IT_GEN1-MTART = GV_MTART.
    ZLBBIL_IT_GEN1-num = lv_num.
    sort ZLBBIL_IT_GEN1 by num.
    Move-corresponding ZLBBIL_IT_GEN1 to gs_it_gen.
    I think, it wont be work out. bcoz stracture doent hold the data..... how to over come the problem.. sorting is very imp for fun guys..
    regards
    chandu

    Hi,
    Actually ive a condtion.. if the material type [mtart] is "yser" .. in the material column should be blank.. the the material type is zrsa. then it needs to print materail and description.
    Material              Description
                                 xyz
                                  abc
                                  laptop
    123                        abc
                                  compu
    456                         pen
    678                        book
    if see the  the  5 th item get the blank ..so there is prob.. first needs to gets the all blanks then print  one who having the mateiral and description.
    but its prints right way.. bcoz its comes based on material type.. but need to sort this....
    how to do it..plz let me know
    thanks
    chandu.P

  • Sort problem in a report

    Hi,
    I'm using the sort on a report with 7 columns. For each column I've specified
    the sort sequence from 1 to 7. The last sort is a date field. If i sort now the
    last column and i change to next report side the sort change jump to the first column.
    Is there somebody who had also a problem like this?
    Greets,
    Tom

    You can check boxes to determine which columns can be sorted; if you check one or more boxes, you also need to set the "Sort Sequence" attribute under the "Report Attributes" tab of your SQL query region. So to use sorting you must.
    1. ensure you don't have an order by in your SQL statement
    2. check one or more "sort" boxes
    3. set the default order in one or more column in the "sort sequence" column
    Hope this helps,
    Mike

  • Sorting Problem in XML Publisher Report

    Dear Members,
    I am facing problems with sorting data in my XML Publisher Report.
    We are using Oracle E-Business Suite 12.1 Version and i developed a rtf Template and executable is an RDF which generates XML Data.
    I want the whole report to group by element ITEM_NAME which is a character in the ascending order. I tried several ways but it is not working properly.
    I don't know how to upload the RTF template in this forum. I tried to post the XML Code and since its excceds 30000 characters i cant post it in the forum.
    Any help is greatly appreciated.
    Thanks
    Sandeep

    You can't upload the template here; you can post a part of the relevant XML code and template code here.
    or send me a sample XML and RTF template to [email protected] and I will take a look.

  • Mail sorting problem after upgrading to Mountain Lion?

    I have a strange problem with Mail after upgrading to Mountain Lion.
    Before upgrading, when I tried to search my Mail Inbox for e-mails from a specific sender, the esearch results would be indexed by the name of the sender. For example: when I entered 'John Smith' in the search box in Mail, it would display a list of email from 'John Smith'
    Now after upgrading, the same query indexes the search results by the 'To' address i.e. my email address.For example: if my name is 'Steve Johnson', a search for 'John Smith' in the search box in Mail displays a list of email to 'Steve Johnson' and not from 'John Smith' which is how it used to display before.
    My emails are sorted by Date always, and I am using the default Mail view [not classic view]
    Can someone please help with a fix for this to help me get back to the original display I had while searching? Thanks in advance.

    I'm having the same problem.  It's incredibly annoying!!!  Did you find an answer?

  • Help with Artist Sort Problem Needed...

    This is a bit long, so I'll start with the three main questions and below them is the backstory and detail of the problem (I did do a search but nothing turned up):
    1) Does anyone know how to fix artist sorting issues where the artists are properly sorted (alphabetically by last name and band name) but there are constant grey-bar letter headings for the first name (sorry...I don't know how to explain better than I do below in detail)
    2) Will re-setting the Touch require I have to...
    a) re-add all the songs I've manually selected again
    b) re-input any data saved to apps (such as CarCare and
    Pocketpedia) and if so, can I backup that data first?
    3) If all the re-doing in 2 above is necessary if I were to re-set the iPod, can anyone think of an alternative fix that would avoid a reset?
    I might be able to get to an Apple store this weekend to ask a "genius" but I'm not that confident in them since I was given some incorrect information on how the Touch handles playlists at the time of original purchase.
    Okay... now, what happened:
    I'm not sure what to make of this, fortunately playback and all main functions are unaffected. I have my iPod Touch 2g set for manual sync. Today, while I was charging it at work, my PC (WinXP) froze. I gave it plenty of time to unfreeze, but eventually had no choice but to do a hard reboot while the iPod said "syncing." I slid the slider to cancel the sync, but the iPod didn't respond. I unhooked it from the PC and it unfroze. I shut it down and re-started.
    Everything seemed fine after the iPod reboot except that now, while the artists are still sorted alphabetically (I've manually set artists to sort by last name), there are headers using the first letter of the first name between each artist. So, for instance, this is how the top of my artist list looks now (lines below with just a letter are the grey divider bar with the alphabetical header):
    R
    Ryan Adams
    D
    Dave Alvin
    T
    Tori Amos
    E
    Eric Andersen
    A
    Apples in Stereo
    Arcade Fire
    L
    Louis Armstrong
    A
    Ataris
    ...etc.
    This problem has not extended to album or song title fields, but for some reason, when scrolling through the album view using the index on the right, it moves fine until "O" -- then it sits still as I scroll down until it gets to "#", at which point it's resposnive again.
    I've checked the music library on the iPod via iTunes and the artist sort fields are still correct.
    Suggestions? I'm new to the Touch and am leery of doing a reset yet since it's taken time to figure out which songs from my 100+gb library to manually put on this. Also, I have no idea how it will affect the apps I've downloaded. There are some where I've saved data (such as CarCare and Pocketpedia) and I REALLY don't want to risk having to re-input all that data.
    To anyone with any words of advice, thanks in advance.
    Message was edited by: IronWaffle
    Message was edited by: IronWaffle

    This is an answer to only qestion 2. Yes restoring your ipod will delete all songs, apps, videos, etc., but you can back up settings like a passcode lock or screen brightness. But it will ask if you want to back up settings. If your'e on windows, in itunes go to file and down almost all the way you will see a "Tranfer purchases from (ex.) steves ipod" and that will make sure you have all your apps and music and other stuff.

Maybe you are looking for

  • Standard Idoc or BAPI to trasfer the routes and stages data

    Hi guys, We want to transfer the routes and stages data from one SAP system to other SAP system . can u suggest any standard idocs or BAPIs to do the job. thanks sankar Edited by: sudhakar murthy on Apr 1, 2009 10:18 AM

  • ORA-01990: error opening password file

    After I unset NLS_LANG ( can you explain this ??? ) I am able to start the create database command. BUt what happens than I do not understand. SVRMGR> connect internal Connected. SVRMGR> startup nomount pfile = /home/oracle/admin/peter/pfile/initpete

  • Blur sensitive data in videos

    Hi, I am evaluating Captivate at the moment for our Marketing Departement. So far I am very happy with it except that I search for a blur function in videos. This would be a must for us to purchase the product. Knowing that it is not suposed to be a

  • Report needs to be printed in full appearance!

    Hi All I've make a report like this image: !http://www8.0zz0.com/2009/12/24/09/973800128.jpg! there is a blank spaces at cells with null values I want to fill all the blank spaces between the appeared rectangles with similar rectangles. How?

  • Apple iMac OS X sluggish

    Good morning. over the last 18 months our iMac has been sluggish and a lot spinning wheels and need to wait a while after I log in to do anything. I am running OS X version 10.9.4 2.5 ghz Intel Core i5 4 GB 1333 MHz memory and have gig HD with 218 gi