Sorting within Bridge

I was using Bridge the other day and noticed that the sorting is not "sticky" from one folder to another.
Example: 
Folder called Choices: sort manually.  Arrange photos the way I want to work with them.
Folder called images:  sort by file name to locate a file to copy to the Choices folder
Go back to the Choices folder:  all files are now sorted by file name and not manually as originally set.
Why does this happen and is there any way to make the individual folders sort independently of the way other folders are sorted?
thanks,
hopper

Robert,
I went back and looked and you are correct in how it sorts.  Thank you for that!    BUT ...
Let me explain the step I was missing to make it work correctly:
Folder called Choices: sort manually.  Arrange photos the way I want to work with them.
Folder called images:  sort by file name to locate a file to copy to the Choices folder
Go bck to the Choices folders, RESET the sorting view back to Manual,  all files are properly sorted manually, as they were prior to step 1 in this example
My error was that, I expected that the folder would remain sorted the way I set it up to be, as it is in Windows.  I didn't realize that I must reset the sort every time.
Thanks for the assistance.
as a side note:  I believe that Adobe should make the sorting "sticky" from one folder to another.  Perhaps in future upgrades?

Similar Messages

  • Can't move image files within Bridge

    I recently bought an iMac and got the CS5 license transferred over to the Mac platform. Got CS5 loaded and everything works except for one critical thing: I can no longer move image files within Bridge. When I do the right click on an image file to select that command, the command is "grey" and won't let me to choose it.  So I am forced to rearrange my image files through the Mac's Finder/Pictures feature.  Drag and drop doesn't work either.  I have looked everywhere for a setting that would allow movement of files to different folders and rearrangement within Bridge, and can't find one.  I have Bridge set as my default for photos and not the lame iPhoto program on Macs.  I previously was to be able to freely use Bridge for organizing my photos on a PC and now sorely disappointed that I can't do this with my new iMac.

    I previously was to be able to freely use Bridge for organizing my photos on a PC and now sorely disappointed that I can't do this with my new iMac.
    No need for disappointment because you can move all files freely within Bridge.
    First check if you have read and write permissions for your files/folders/disk (try move the files using finder) If Finder allows you to drag the files to the location you previously wanted in Bridge then the problem lies in Bridge.
    First select a file and with right mouse click menu choose purge cache for selection. If the problem is gone you could do so for the whole folder using menu tools/cache/purge cache for folder while having Bridge pointed to that folder.
    If not restart bridge holding down option key and choose reset preferences.
    could you report back?

  • Opening Camera Raw within Bridge

    I just recently installed Photoshop CS3, and within bridge when I try to open up any raw image, it opens it up in camera raw, but within photoshop. I can't find the option that allows me to open camera raw within bridge without having to launch photoshop.
    I've tried the help pages and what they've described for me to enable this function can't be found...so weird. Any help would be greatly appreciated!
    Henry

    I would really appreciate anyone figuring this one out. I'd rather not have to reformat my mac AGAIN. I just had to because photoshop cs3 was not installing properly. I am running OSX10.4.10 or somthing like that.
    I have Design Premium CS3.
    While in Bridge, there is no option to open in CameraRAw, whether I right click or click on File.
    In the Preferences, there is no option to make "double click opens in CameraRaw."
    Work flow is seriously hampered by this defect.
    I purged my cache, but I don't see how to reset all settings.

  • Losing manual sort in Bridge collections

    I installed the latest version of Bridge CC and created several collections. Each collection contains between 10 and 60 images which are all taken from the same Windows directory. The directory contains less than 300 image files. I did this in two sessions. In the first, I created 3 collections and in the second, I created 5 more. Each collection was manually sorted after all the images were added. No additional images were added after the manual sort.
    After restarting Windows and opening Bridge CC again, some collections were still manually sorted and some were sorted by filename. All the collections are still showing as manual sort. Can't figure out why some are OK but others are in filename order even though it shows manual sort.
    I'm running on Window 8 Pro and have InDesign installed as well. Bridge is not set to start at login.
    Now, the only thing I can think of is that when I updated InDesign in Adobe CC this morning, that something may have affected Bridge. But then I would have expected all the collections to revert to filename order and not just some.
    Is there a secret to keeping the manual sort in Bridge collections intact? It's not much use to me if it won't. I sort images in the order I want to insert them in book pages.
    I checked other threads on this subject but it doesn't look like anything was resolved.
    Thanks

    DUUUUUUUDE! IT'S WORKING NOW!!!!
    When you originally asked, "What happens if you click on an image and move it to another folder?", I didn't really understand what you were talking about because I almost never have my workspace set up in a way that the folders are showing. I always hide them. So I didn't really understand what you were saying. Just a few minutes ago, I realized that that is what you were asking so I opened up the folder area and tried dragging thumbs into different folders and saw that it does work.
    So then, because of you mentioning that blue line and me know that I did see the blue line on occasion. I went back over into the thumbnails to find out if I always got the blue line or if it was a hit or miss thing. I couldn't believe my eyes when all of the sudden I saw that I no longer was getting that circle with the line through it, and low and behold, the thumbnail dropped right into position like it is supposed to!!!!
    The thing is, I don't know what I've learned from this. I thought, "well, what is different?" The only thing that I can think of is that I now have the folders showing in my workspace so I wondered if that was the secret but I just now hid the folders again like I usually do and the drag and drop into position is STILL WORKING!!!
    All I can figure is that somehow, dragging and dropping a thumbnail into a folder like that for the first time, triggered something so that I can now drag and drop among the thumbnail positions? Not sure. All I know is that for some reason, IT'S WORKING NOW!
    Now, for the second important part, I wonder if I drag and drop everything into the order that I want and then select all of the files and drag them into a new folder, will they stay in that order? I need to go experiment with that.
    If you hadn't kept at it and in turn had me keep trying stuff, it would have never happened because I had pretty much given up.
    Thanks Curt!
    You da man!!!

  • How do you sort mini bridge manually?

    Is there a way to sort mini bridge manually? I have manually sorted images for an album design in Bridge but when I open Mini Bridge in Indesign they are sorted by filename. I do not see a sort option to sort manually. Wondering if anybody has a solution other than to rename files from Bridge.
    I am using InDesign and Bridge CS6 on a Windows 7 computer via the Adobe cloud.

    Yes, when I do that it sorts the albums in the folder by name.
    I may have misused terminology, I meant Smart Albums not smart folders, if this makes a difference.
    Thanks for your help!

  • How to access script from within Bridge

    I have considerable experience scripting InDesign, but this is my first
    Bridge script...
    The following script does what I want from within the ESTK, but I have
    no idea what to do to make it runnable from within Bridge... :(
    Any pointers?
    var brSel = app.document.selections[0].spec.toString();
    var bt = new BridgeTalk();
    //brSel = brSel.toSource();
    bt.target = "indesign";
    theScript = "var IDsel = app.selection[0]; \n";
    theScript += "if (IDsel instanceof Graphic){ \n";
    theScript += "var theGraphic = IDsel;\n";
    theScript += "}else{\n";
    theScript += "var theGraphic = IDsel.graphics[0];\n";
    theScript += "}\n";
    theScript += "var theFile = File(\""+brSel+"\");\n";
    theScript += "theGraphic.itemLink.relink(theFile);\n";
    theScript += "theGraphic.itemLink.update();\n";
    bt.body=theScript;
    bt.send()
    Thanks,
    Harbs

    Harbs,
    There isn't anything like a scripts palette in Bridge.
    Because your working on a selection, you'll need to add a menu item to bridge.
    You can also navigate to the folder containing the scripts and double click it. But then the script is the selection...
    Bob

  • Sort within an array?

    public class Input3
         private String[] input = new String[40];
         private static int StringNum = -1;
         public static final int NUMBER_OF_TEAMS = 3;
         public static final int NUMBER_OF_PLAYERS = 5;
         public Input3()
              //The first six inputs will be for the first team
              input[0] = "LAKERS";
              input[1] = "Kobe Bryant";
              input[2] = "Derek Fisher";
              input[3] = "Shaquille O'Neal";     
              input[4] = "Karl Malone";
              input[5] = "Brian Cook";
              //The next six inputs will be for the second team
              input[6] = "MAVERICKS";
              input[7] = "Antoine Walker";
              input[8] = "Dirk Nowitzki";
              input[9] = "Tony Delk";
              input[10] = "Shawn Bradley";
              input[11] = "Travis Best";
              //The next six inputs will be for the third team
              input[12] = "KNICKS";
              input[13] = "Mike Sweetney";
              input[14] = "Allan Houston";
              input[15] = "Howard Eisley";
              input[16] = "Kurt Thomas";
              input[17] = "Shanon Anderson";
         //This method returns the strings one after the other.
         public String getNextString()
              StringNum++;
              return input[StringNum];
    }What I'm supposed to do with this is sort that data by last names within each team. By that I mean I have to sort input[1] through input[5] by last names, input[7] through input[11] by last names, and same for the Knicks team. I'm not sure how to do 3 separate sorts within an array.
    The output should look like this:
    KNICKS:
    Sharon Anderson
    Howard Eisley
    Allan Houston
    Mike Sweetney
    Kurt Thomas
    Any help is greatly appreciated!

    Yeah, I don't really understand it. But my professor actually gave us that code to work with to be part of a bigger assignment. I actually just posted another question about the same assignment if you want to look at that to see if it might help.
    I dunno how to use the insert link button on here so I'll just let you copy and paste if you are interested in helping me out... Thanks!
    It's here >>> http://forum.java.sun.com/thread.jspa?threadID=5268839

  • Custom sorting within "for-each-group:current-group"

    Hi, I need some help in doing a custom sort within a "for-each-group:current-group". My formatting is in a table format but I'm not sure how to post a table here so I'm just arranging the column details out as it would look in a table. I have a column on the left for the YEAR and a second column on the right for the DESCR. Under the DESCR column I've inserted a nested table with four columns: SUBJECT, CATALOG_NBR, DESCR250 and GRADE.
    COLUMN 1:
    <?for-each-group:row_table;./ YEAR?><?sort: YEAR;'ascending';data-type='text'?><?YEAR?>      
    COLUMN 2:
    <?for-each-group:current-group();./DESCR?><?DESCR?>
    NESTED TABLE (with 4 columns):
    +<?for-each:current-group()?><?SUBJECT?><?CATALOG_NBR?><?DESCR250?><?GRADE?><?end for-each?>+
    <?end for-each-group?> <?end for-each-group?>
    I'm able to sort by YEAR in the "for-each-group" on the left column. But I also want to do a custom sort on DESCR in the right column.
    I've seen this blog on custom sorting by Vetriselvan: http://winrichman.blogspot.com/2009/09/custom-dynamic-sort-in-bi-publisher.html and I tried inserting this sort below after <?for-each-group:current-group();./DESCR?> but I get an error message.
    <?sort:(number(DESCR='Status')*1)+(number(DESCR='First Semester')*2)+(number(DESCR='Second Semester')*3);'ascending';data-type='number'?>
    I've also seen this thread: Re: Sort within group and tried inserting <?for-each:DESCR?> before the sort (as below) - this time I can preview the results, but it is not sorting as required.
    <?for-each:DESCR?><?sort:(number(DESCR='Status')*1)+(number(DESCR='First Semester')*2)+(number(DESCR='Second Semester')*3);'ascending';data-type='number'?>
    Can anyone help me custom sort the DESCR column? I'm using Template Builder for Word version 5.6 build 45. Thanks in advance for any help!

    Hi Vetsrini,
    I tried adding <?sort: ./DESCR;'ascending';data-type='text'?> after <?for-each-group:current-group();./DESCR?> but I'm getting an error message.
    The DESCR values are below and I'm trying to sort them in the following order.
    STATUS
    SUMMER SEMESTER
    FIRST SEMESTER
    AUTUMN SEMESTER
    WINTER SEMESTER
    SECOND SEMESTER
    SPRING SEMESTER
    Because I need them in the above order, I can't use ascending or descending, and instead need to use a custom sort order. Do you know how I can go about creating a custom sort order?
    Thanks!

  • Not able to use @section and Sort within a group in RTF Template

    When i try to use sort with for-each-group@section in my template, the Output Post processor is throwing the following exception
    Caused by: oracle.xdo.parser.v2.XSLException: <Line 31, Column 84>: XML-22047: (Error) Invalid instantiation of 'xsl:sort' in 'fo:flow' context.
    My tags in the RTF template are as below:
    <?for-each-group@section:G_PERSON_ID;./DEPT?><?sort:DEPT;'ascending';data-type='text'?>
    -- there are 2 more groups within this.
    <?end for-each-group?>
    I don't get the error if i remove @section from the above tag in my RTF template.
    OR
    IF i remove the sort tag and keep the @section , it still works.
    I need the "sort" so that i can sort the output by department number and I need the "section" so that i can acheieve context based header title for the page using the tag given below in the header area of the word RTF doc. The DEPT number should change as per the data shown in the report.
    DEPT <?DEPT?> CLASSIFICATION SENIORITY LISTING BY CLASS CODE & DATE
    I am stuck with either being able to use the Sort or the Header feature but not both.
    I guess that section is needed for the context based header title to work, because all the data shown in the current page should correspond to only one single DEPT value (to make the Header title consistent with the data). But i dont get why i am not able to sort. The exception from OPP simply beats me. Please help!!
    I am using the XML Pub Desktop 5.6.2 to develop my templates.
    Is there any way to acheive this? Can someone throw some light on this.
    Thanks in advance.

    Help About says I'm on 20.0.1
    Up until last week, I was able to use the tab key when typing emails and other multi-line text boxes.
    Suddenly the behavior of the tab key changed. This isn't the first time. It's been quite a while ago that the function of the tab key changed from indenting to moving around the page, then after some time it changed back to indenting.
    Can we get this fixed and leave it alone, please?
    I may give one of those add-ins a try, but my problem with add-ins is that they break when FF is patched or upgraded, then I'm left with out the solution they provide.
    Can we just fix Firefox, please?
    Thanks,
    Frank
    P.S. Another potential fix I came across suggested starting FF in safe mode to see if the problem goes away. It does not. It seems to be a change to FF that appeared after an update last week. On or just befor 24 Apr.

  • Batch of files manually sorted in Bridge - Can I run a PS Action in that manual order?

    For some jobs my workflow ideally involves manually sorting the order of a batch of RAW files in Bridge (the RAW file names are as assigned by the camera) and then using a PS Action from Bridge to convert, save, and rename the batch of files. I want to end up with my image files sequentially numbered in the manually sorted order.
    However, my PS Action automatically processes the files in ascending order of their RAW file names and therefore my manually assigned file order in Bridge is lost.
    Is there a script (or other method) which will allow me to run a PS action from Bridge on a batch of files while keeping the manually sorted order for the purposes of the numbering sequence of the renamed output files?
    My current workaround is to Batch Rename in Bridge a copied set of RAW files as an intermediate step to running my PS Action on the renamed RAW file copies. It's not a bad workaround but if there is an easier way, I would much appreciate knowing about it!
    Geoff

    Geoff, here is an example that works for me. When I test ran the sample script based on some stuff that I do the files are process in the order of the manual sort and only the files in my selection are processed folders etc are ignored… I have NO idea how much people charge for this sort of thing I only do it for the learning process. If you can let me know what the Photoshop process is and your OS I 'may' be able to help but I make NO promises as Im still very much the learner with this stuff…
    You can give this a test if you like…
    #target bridge
    with (app.document) {
         if (sorts[0].type == 'user') {
              if (selections.length == 0) {
                   selectAll();
                   var userSel = selections;
                   deselectAll();
              } else {
                   var userSel = selections;
              for (var i = 0; i < userSel.length; i++) {
                   if (userSel[i].type == 'file') psProcess(userSel[i].spec);
         } else {
               alert('This window is NOT a manual sort?')
    function psProcess(filePath) {
         var psScript = 'while (app.documents.length) app.activeDocument.close(SaveOptions.PROMPTTOSAVECHANGES);' + '\n';
         psScript += 'var userDialogs = app.displayDialogs; \n';
         psScript += 'var userRulerUnits = app.preferences.rulerUnits; \n';
         psScript += 'app.diaplayDialogs = DialogModes.NO; \n';
         psScript += 'app.preferences.rulerUnits = Units.PIXELS; \n';
         psScript += 'app.bringToFront(); \n';
         // Pass File Object as toSource
         psScript += 'var thisFile = ' + filePath.toSource() + '; \n';
         psScript += 'var docRef = app.open(thisFile); \n';
         psScript += 'var baseName = docRef.name.slice(0, -4); \n';
         // Edit the document
         psScript += 'if (docRef.bitsPerChannel == BitsPerChannelType.SIXTEEN) docRef.bitsPerChannel = BitsPerChannelType.EIGHT; \n';
         psScript += 'if (docRef.mode != DocumentMode.RGB) docRef.changeMode(ChangeMode.RGB); \n';
         psScript += 'if (docRef.colorProfileName != "sRGB IEC61966-2.1") docRef.convertProfile("sRGB IEC61966-2.1", Intent.RELATIVECOLORIMETRIC); \n';
         psScript += 'docRef.flatten(); \n';
         // Call some functions
         psScript += 'processChannels(docRef); \n';
         psScript += 'processPaths(docRef); \n';
         psScript += 'if (docRef.pathItems.length >= 1) processSelection(docRef, 0); \n';
         psScript += 'fitImage(docRef, 880, 72); \n';     
         psScript += 'docRef.resizeCanvas(900, 900, AnchorPosition.MIDDLECENTER); \n';
         // set up new file path to save document
         psScript += 'var newFilePath = new File("~/Desktop/" + baseName + ".jpg"); \n';
         psScript += 'saveFileasJPEG(newFilePath, 9); \n';
         //      Close doc & put back prefs
         psScript += 'app.activeDocument.close(SaveOptions.DONOTSAVECHANGES); \n';
         psScript += 'app.diaplayDialogs = userDialogs; \n';
         psScript += 'app.preferences.rulerUnits = userRulerUnits; \n';     
         // Use eval & toSource for Photoshop functions
         psScript += 'eval' + processChannels.toSource(); + '; \n';
         psScript += 'eval' + processPaths.toSource(); + '; \n';
         psScript += 'eval' + processSelection.toSource(); + '; \n';
         psScript += 'eval' + fitImage.toSource(); + '; \n';
         //psScript += 'eval' + imageArea.toSource(); + '; \n';
         //psScript += 'eval' + saveFileasTIFF.toSource(); + '; \n';
         psScript += 'eval' + saveFileasJPEG.toSource(); + '; \n';
         // Send script to Photoshop
         btMessaging('photoshop', psScript);
    General Functions
    function btMessaging(targetApp, script) {
         var bt = new BridgeTalk();
         bt.target = targetApp;
         bt.body = script;
         bt.send();
    function createFolder(folderPath) {
         var thisFolder = new Folder(folderPath);
         if (!thisFolder.exists) thisFolder.create();
    Photoshop Functions
    function processChannels(docRef) {
         for (var i = docRef.channels.length-1; i >= 0; i--) {
              if (docRef.channels[i].kind == ChannelType.MASKEDAREA) {
                   docRef.channels[i].remove();
                   continue;
              if (docRef.channels[i].kind == ChannelType.SELECTEDAREA) {
                   docRef.channels[i].remove();
                   continue;
              if (docRef.channels[i].kind == ChannelType.SPOTCOLOR) {
                   docRef.channels[i].merge();
    function processPaths(docRef) {
         if (docRef.pathItems.length >= 2) {
              for (var i = 0; i < docRef.pathItems.length; i++) {
                   if (docRef.pathItems[i].kind == PathKind.CLIPPINGPATH) {
                        docRef.pathItems[i].makeClippingPath(0.5);
                        docRef.pathItems[i].makeSelection(0, true, SelectionType.REPLACE);
                        docRef.pathItems[i].deselect();
      if (docRef.pathItems.length == 1) {
              if      (docRef.pathItems[0].kind == PathKind.WORKPATH) docRef.pathItems[0].name = 'Clipping Path'
              docRef.pathItems[0].makeClippingPath(0.5);
              docRef.pathItems[0].makeSelection(0, true, SelectionType.REPLACE);
              docRef.pathItems[0].deselect();
    function processSelection(docRef, offSet) {
         if (docRef.layers[0].isBackgroundLayer) docRef.layers[0].isBackgroundLayer = false;
         docRef.selection.expand(offSet);
         docRef.selection.invert();
         docRef.activeLayer = docRef.layers[0];
         docRef.selection.clear();
         docRef.selection.deselect();
         docRef.trim(TrimType.TRANSPARENT, true, true, true, true);
         docRef.flatten();
    function fitImage(docRef, newSize, newRes) {
      if (docRef.width >= docRef.height) {
         docRef.resizeImage(newSize, undefined, newRes, ResampleMethod.BICUBICSMOOTHER);
      else {
         docRef.resizeImage(undefined, newSize, newRes, ResampleMethod.BICUBICSMOOTHER);
    function imageArea(docRef, newArea, newRes) {
      var originalArea = docRef.width * docRef.height;
      if (originalArea > newArea) {
         var newWidth = Math.sqrt(docRef.width * newArea / docRef.height);
         var newHeight = (docRef.height * newWidth / docRef.width);
         docRef.resizeImage(newWidth, newHeight, newRes, ResampleMethod.BICUBICSMOOTHER);
      else {
         docRef.resizeImage(undefined, undefined, newRes, ResampleMethod.NONE);
    function bitmapOptions(res) {
      bitOptions = new BitmapConversionOptions();
         bitOptions.method = BitmapConversionType.HALFTHRESHOLD;
         bitOptions.resolution = res;
         bitOptions.shape = BitmapHalfToneType.SQUARE;
         return bitOptions;
    Photoshop Save As Functions
    function saveFileasTIFF(saveFile, aC, iC, la, sC, tr) {
         tiffSaveOptions = new TiffSaveOptions();
         tiffSaveOptions.alphaChannels = aC;
         tiffSaveOptions.byteOrder = ByteOrder.MACOS;
         tiffSaveOptions.embedColorProfile = true;
         tiffSaveOptions.imageCompression = iC;
         tiffSaveOptions.layers = la;
         tiffSaveOptions.spotColors = sC;
         tiffSaveOptions.transparency = tr;
         activeDocument.saveAs(saveFile, tiffSaveOptions, true, Extension.LOWERCASE);
    function saveFileasJPEG(saveFile, qL) {
         jpgSaveOptions = new JPEGSaveOptions();
         jpgSaveOptions.embedColorProfile = true;
         jpgSaveOptions.formatOptions = FormatOptions.STANDARDBASELINE;
         jpgSaveOptions.matte = MatteType.NONE;
         jpgSaveOptions.quality = qL;
         activeDocument.saveAs(saveFile, jpgSaveOptions, true, Extension.LOWERCASE);

  • Moving to trash within Bridge

    hello.
    when in Bridge and i COMMAND + SHIFT to delete a file within the window, it doesn't dissapear. but if i move up a folder and back down, it's gone.
    i tried deleting preferences, caches, etc... and that didn't do anything.
    any help?
    thanks so much

    hello.
    i can do the delete, but after i've done it the file still shows in the Bridge window. it does not dissapear. if i look in my Trash the file is in there. i have to leave the current window in Bridge and go back to it for the window to be updated and show the file gone.

  • Files Not Sorting Within Folders

    I have my working AppleWorks files on my external HD. Recently the files within folders donot sort. As a test I changed a file name staring with an M to an A. The file did not sort to the top of the list. As far as I can tell nothing has changed within my system. The files on my system HD are OK. The other files on the external HD are OK - only the AW files are wrong.
    Under the "view" options the name sort is only available for the Desktop. When I open the external HD or highlight a folder the name sort option is not available. I must be missing something but what..
    Bob61

    Problem solved. Clicked on the name column and went from there. So soon we forget!!Bob61

  • Sort within group

    I have several groups within groups, and on my last grouping:
    <?for-each-group:current-group();./TASK?>
    I'd like to sort alphabetically by task, but can only seem to sort on the highest group I have:
    <?for-each-group:G_DEPT;./DEPT?><?sort:DEPT;'ascending';data-type='text'?>.
    Is it possible to sort on the current group task? I just get a dump when I try to add the sort tag after for each statement.
    thanks

    I'm not sure about your <?for-each-group?> element because I haven't seen your data. This is an example from one of my reports.
    <?for-each-group: current-group();ELEMENT_NAME?>
    <?for-each:ELEMENT_NAME?>
    <?sort:PROC_PRIORITY?>
    HTH
    - Dan Stober
    Salt Lake City

  • Cannot sort within TreeSet

    Hello,
    i have the following problem. I want to sort a file within TreeSet. I want to sort it after the value, not the Key. But it doesn't work...
    I have a file that looks so:
    academic 2
    addison 4
    agents 1
    alan 1
    algorithm 3
    algorithms 3
    alternative 1
    ant 2
    api 2
    applied 1
    applying 1
    april 8
    archive 1
    art 1
    arthur 2
    athena 4
    b551 3
    beasley 1
    bertsekas 3
    binder 2
    booch 2
    books 3
    borland 1
    chain 3
    chains 2
    class 1
    coding 1
    cohen 1
    colony 1
    ...and I want to sort them after the "number".
    So I use treeset to do that and take an own class, called "sorting.java" to sort that stuff after the numbers.
    That is the class sorting:
    import java.util.*;
    import java.io.*;
    public class sorting implements Comparable
            public String text;
            public int number;
            public sorting(String t, int n) 
                    text = t;
                    number = n;
            public void setText(String text)
                    this.text = text;
            public void setNumber(int number)
            this.number = number;
            public String getText()
            return text;
            public int getNumber()
            return number;
                    // compareTo methode from the interface Comparable
                    // 0 means objects are equal -> new object will not be sorted in
                    // 1 means Object o is bigger than o
                    // -1 means Object o is smaller than o
            public int compareTo(Object o)
                    if(o == null || !(o instanceof sorting) || this == o)
                            return 0;              // object is null or from another type or the same 
                    sorting mc = (sorting)o;
                    // the text will be compared
                    int comp = text.compareTo(mc.getText());
                    // texts are the same
                    if(comp == 0)
                    // number will be compared
                            if( mc.getNumber() > number)
                                    return 1;
                            return -1;
                    // the result of the cpmparison the thext will be returned
                    return comp;
    }and then I add the File to TreeSet:
    import java.io.*;
    import java.util.*;
    public class test
            public static void main(String []args)
                    throws Exception
                    String text = "l";
                    int number = 0;
                    TreeSet tree = new TreeSet();
                    FileReader n = new FileReader("neuhttp:**aps.im.isu.edu.tw*papers.htm");
                    BufferedReader reader = new BufferedReader(n);
                    String string_und_Zahlen;
                    String line = "", firstToken = "";
                    int secondToken = -1;
                    StringTokenizer st = null;
                    while((line = reader.readLine()) != null)  
                    {                                                                       // if line is null you have reached EOF
                            st = new StringTokenizer(line);                                 // using the default delimiters
                            text = st.nextToken();
                            number = Integer.parseInt(st.nextToken());                      // getting the token and converting it to an int
                            tree.add(new sorting(text, number));
                    Iterator iter = tree.iterator();
                    sorting s;
                    while (iter.hasNext())
                            s = (sorting)tree.first();                         // "first()" gives me the first objekt from the treeset, cause i only want to have the object with the highest number ...
                            System.out.println(s.getText() + "   " + s.getNumber());
    }but I get the first line from the unsorted file.... WHY?
    academic   2
    academic   2
    academic   2
    academic   2
    academic   2
    academic   2
    academic   2
    academic   2
    academic   2
    ...

    Hi,
    just some suggestions:
    your class sorting does not fulfil all the requirements for a TreeSet:
    - the implementation of compareTo has at least one error: if both objects are equal, then you return -1 instead of 0.
    - the class sorting has no consistent implementation of equals and hashCode.
    Might be, this causes your problems!

  • Sort within arrangement?

    I arrange my Finder folders by kind. I love the ability to see my folders at the top of the listings. In the Finder windows themselves, they are nicely sorted by name within kind. However, when I use a SaveAs/Open dialog, they are arranged but no longer sorted. Very inefficient!
    Anyway of fixing this?
    TIA,
    David

    Hi
    If you need independent control of each LoopBack I would not group them. Simply use one as a "Master" and have all the others play in Sync with the MS clock.
    I use individual Play, Stop Record etc controls for each LoopBack. Set them to Start at the beginning of a Bar
    CCT

Maybe you are looking for

  • Can't log in with a family member ID

    Dear all, I'd have a question about family member log in to iCloud. I own a mobile me family pack account which I upgraded to iCloud. Master account works great on my Mac. I have troubles using family members accounts. I made the same operations for

  • Unix Command for tracing WebIntelligence Server

    Hi All, Please can any one tell me that what is the Unix command for tracing WebIntelligence Server. I know we use -trace parameter. But where do we use this parameter? With which script do we use it? Please give me complete command for the same. Tha

  • EDGE NO LONGER PREVIEWS

    I initially created a slideshowpm my Mac using Edge Preview. I could easily preview the slideshow in Safari. Edge Preview Expired so I downloaded Edge Animate. Now, however, I can no longer preview my slideshow in Safari. What's Up with that?

  • Transformation of Rows to Column in HANA

    Hi All, I have a requirement of converting rows to columns. For Ex - I have date in my view as below - My requirement is I want to convert the above in columnar structure as - Please suggest how can I achieve the same. Regards, Nakul Kothari +9987039

  • Possible to change active print preset across documents via scripting?

    Hi everybody. I have a ton of documents that were created previously, and the default/custom print preset is selected any time I go to print them. I'm going to be printing them using a script, but I would like to change the active preset in each docu