I need to sort an array of strings based on the number in each string.

Basically, I have a directory of files that all have the same name but each with a different number on the end.
example: image 1.jpg, image 2.jpg, etc.
When I use the List Directory function that returns an array of strings containing the file names in the directory, they don't come out in a 1, 2, 3, order like they appear in the directory. It sorts them character by character so that they come out like: 1, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 2, 20, 21, 22 etc.
Is there a simple way of sorting this array of strings with the file names (as above) so that they are in numerical order?

It's a while since this thread was started, but I am sure others will have use for this so here goes:
The in-built array sort function sorts the strings the same way DOS and Windows do. Microsoft has fixed this in the Explorer that comes with XP, however the rest of the OS(s) still sorts the old way.
The attached "AlphaLogical String Array Sort" VIs will sort strings arrays the same way as the new XP Explorer. There are three different implementations of the sorting, one based on the Insertion sort algorithm, a Quick Sort based on recursive calls (the most elegant way, but unfortunately LabVIEW has too much overhead when doing recursive calls so this is actually a very slow alternative) and finally the fastest; a stack based Quick Sort. There is also a test VI that will show you how the different implementations perform.
I had not used recursive calls in LV much until I made the attached quick sort and was a bit disappointed by the fact that it is so slow, but it's a good learning example...The ability to do recursive calls this way was introduced in LV7 I believe...There is an example here on the zone that shows how you can calulate a factorial by using recursive calls, however - unlike for the quick sort (normally) - recursive calls are actually not the optimal solution for that calculation.
Message Edited by Mads on 09-13-2005 02:30 AM
MTO
Attachments:
AlphaLogical Sorting.zip ‏142 KB

Similar Messages

  • Sorting an array of Objects based on a variable inside each object

    I have a class public class handInfo
              //VARS
                   int highC = 0;
                   int hVal = 0;
                   int numHand = 0;
              //CONSTRUCOTRS
                   public handInfo()
              //METHODS
                   public void setHC(int hc)
                             highC = hc;
                   public void setHV(int hv)
                             hVal = hv;
                   public void setNH(int nh)
                             numHand = nh;
                   public int getHC()
                             return highC;
                   public int getHV()
                             return hVal;
                   public int getNH()
                             return numHand;
         }now i have an array, handInfo[] hands = new handInfo[4];
                        hands[0] = new handInfo();
                        hands[0].setHC(HV);
                        hands[0].setNH(1);
                        hands[0].setHV(Val);
                        hands[1] = new handInfo();
                        hands[1].setHC(HV2);
                        hands[1].setNH(2);
                        hands[1].setHV(Val2);
                        hands[2] = new handInfo();
                        hands[2].setHC(HV3);
                        hands[2].setNH(3);
                        hands[2].setHV(Val3);
                        hands[3] = new handInfo();
                        hands[3].setHC(HV4);
                        hands[3].setNH(4);
                        hands[3].setHV(Val4);i need to know how to sort this array, based off hVal...
    D:

    Write a Comparator and call Arrays.sort(array, Comparator).

  • Trouble with output string size of the 'number to hexadecima​l string' VI

    Hi everyone.
    I am new to Labview, so I apologise if this question is too simple. I am trying to convert a float to a hex string so I can pass it to a VISA Write VI. I first cast it, so it becomes a 32-bit int and then on to the 'number to hex string' VI. Now, since after the casting the number is a 32-bit int, I would assume that the output hex string would also be 32-bit long (so 4 bytes, which is what I need). However, I use the 'string length' Vi and it says the hex string is 8-byte long. Could someone please tell me why this is the case?
    Thank you very much in advance,
    Gabriel

    Are you sure it is 8 bytes? Don't confuse a nibble and a byte.
    Try the "flatten to string" function. 
    "There is a God shaped vacuum in the heart of every man which cannot be filled by any created thing, but only by God, the Creator, made known through Jesus." - Blaise Pascal

  • Need help sorting 2 arrays linked by their indexes

    I have 2 arrays that have been linked by the index of both arrays. The first array has to be sorted alphabetically, so I need a way to sort the 2nd array so that the indices match up again with the first array.
    Now, I cannot change my ArrayList (i.e. TreeSet, List, etc.) since there is lots of code that would have to be changed. Here is my test code. Hopefully everyone is a fan of the television show Friends so that you can see how if I sort the firstName Array alphabetically, then I have to have the 2nd array sorted to be "linked" back to the first array based on the index. I am looking for ideas, but if you have simple code, that would be great too.
    import java.util.*;
    public class Test
         public static void main(String[] args)
              System.out.println("BEGIN TEST...");
    Test test = new Test();
    test.beginTest();
    System.out.println("\nTEST COMPLETE!");
         public Test(){}
         public void beginTest()
              ArrayList firstName = new ArrayList();
              ArrayList lastName = new ArrayList();
              //Add to firstName ArrayList
              firstName.add("Ross");
              firstName.add("Chandler");
              firstName.add("Rachel");
              firstName.add("Phoebe");
              firstName.add("Joey");
              //Add to lastName ArrayList
              lastName.add("Geller");
              lastName.add("Bing");
              lastName.add("Green");
              lastName.add("Buffay");
              lastName.add("Tribbiani");
              try
                   System.out.println("TESTING...\n");
                   for(int index=0; index<firstName.size(); index++)
                        String first = firstName.get(index).toString();
                        String last = lastName.get(index).toString();
                        System.out.println("Hi, I am " + first + " " + last + ".");                    
              catch(Exception X) { System.out.println("EXCEPTION! "+X); X.printStackTrace(); }
    }

    Keeping the list in synch is conceptually easy.
    Basically anything you do to the one List, you have to do to the other in order to keep them consistent.
    How are you sorting your "firstnames" list?
    Using the Collections.sort method, or some manual coding?
    Would it be possible to change your datastructure from "parallel arrays" to "List of people objects"
    iepublic class Person {
      String firstName;
      String lastName;
      public Person(String firstName, String lastName){
        this.firstName = firstName;
        this.lastName = lastName;
      // appropriate getter/setter methods
    }Then you could build up your list like this:
    List friends = new ArrayList();
    friends.add(new Person("Ross", "Geller"));
    friends.add(new Person("Chandler", "Bing"));
      ...Now when you sort the list, the last name always goes with the first name because they are in the same object.
    You then write different Comparator objects to impose different orderings.
    Hope this helps,
    evnafets

  • I need help sorting an Array.

    Hi, I need to make a program that reads a string (sentence), then it counts the number of times each letter is "typed". As an optional challenge, the teacher told us to sort the results from the most repeated, to the least.
    My program is working pretty well, here is the code:
    import java.lang.String;
    //import java.util.Collections;
    //import java.util.*;
    public class count {
         final int alpha = 66;
         int [] lower = new int [alpha];
          * @param args
         public static void main(String[] args) {
              // TODO Auto-generated method stub
              java.util.Scanner in = new java.util.Scanner (System.in);
              char current;
              final int alpha = 66;
              int [] lower = new int [alpha];
              int Spaces = 0;
    System.out.println("Enter a sentence:");
    String line = in.nextLine ();
    //int length = line.length();
    line = line.toLowerCase();
    for (int ch = 0; ch < line.length(); ch++)
    current = line.charAt(ch);
    if (current >= 'a' && current <= 'z')
    lower[current-'a']++;
    else if (current == ' ')
    Spaces ++;
    System.out.println();
    for (int letter=0; letter < lower.length;letter++)
         if (lower[letter]>0){
    System.out.print((char)(letter + 'a'));
    System.out.println(": " + lower[letter]);
         System.out.println ();
         System.out.println ("Spaces: " + Spaces);
         }[now, I want to sort the results. I tried using Arrays.sort(lower); but it doesnt work as it should. Example:
    String: Hello
    not sorted:
    e: 1
    h: 1
    l: 2
    o: 1
    Spaces: 0
    "sorted":
    : 1
    .:1
    ]:1
    ~:2
    Spaces: 0
    I would really appreciate your help.
    Thanks, J. Flemming

    Since you didn't post your Arraays.sort code, I can't
    tell what you did wrong.
    What does your array store? Element 0 is the number
    of 'a' occurences, 1 is 'b', etc?
    If so, then when you sort that, you'll have no idea
    which element corresponds to 'a'. You'll need a
    different approach for that. For instance, a class
    that encapsulates two pieces of data: character and
    number of occurences. You could then implement your
    own sort, or learn how to use Comparable/Comparator.
    Making Java
    Objects Comparable
    http://java.sun.com/docs/books/tutorial/collections/in
    terfaces/order.html
    http://www.javaworld.com/javaworld/jw-12-2002/jw-1227-
    sort.htmlAs I said in my original post, I used Arrays.sort(lower), which is probably wrong. My Arrays does work as you described, element 0 is the numer of occurrences of 'a', and 1 is the number of occurrences of 'b' and so on. Thanks for your responce. Im looking into what you said. Thanks again.
    Message was edited by:
    Flemm.John

  • Can I replace several elements of an array within one time? The number of elements are not fixed

    Hi all,
    I want to replace some elements of a 2D array, but the number of elements are not known beforehand. I dont want to do it with a loop, which may slow down the speed, and the update of elements will not happen simultaneously.  The indexes of elements to be updated are not continuous. I wonder if there is a way to do that efficiently? Do I have to programme it in LabWindows/CVI? Thank you.
    Best wishes,
    Bo
    My blog Let's LabVIEW.

    Use the replace elements function. For non-continuous replacements  of of multiple elements you would nee to iterate at least the number of continous pieces.
    For example:
    1,2,3,4,5,6,7,8,9
    Replace elements 1,2,5,6,8
    You would need 3 iterations in which you can replace (1,2), (5,6) and (8).
    Regards,
    André
    Using whatever version of LV the customer requires. (LV5.1-LV2012) (www.carya.nl)

  • How to extract substring from a string based on the condition ??

    Hi,
    I'm having a very large string which as below
    EQD+CN+SAMPLE18767+2200+++5'
    NAD+CA+FIR:172:20'
    DGS+IMD+3.2+2346+55:CEL'
    FTX+AAA+++GOOD'
    FTX+AAA+++ONE'
    EQD+CN+SAMPLE18795+2200+++5'
    NAD+CA+TIR:172:20'
    DGS+IMD+3.2+2346+55:CEL'
    FTX+AAA+++SECOND'
    FTX+AAA+++IS FAIR'
    similarly FTX+AAA as above and it goes on
    i tokenized each segment with delimiter as ' and able to read each segment.
    Now i want to concatenate the FTX+AAA in a single segment if more than one FTX+AAA with IMMEDIATE below
    The output is as follows
    EQD+CN+SAMPLE18767+2200+++5'
    NAD+CA+FIR:172:20'
    DGS+IMD+3.2+2346+55:CEL'
    FTX+AAA+++GOOD,ONE'
    EQD+CN+SAMPLE18795+2200+++5'
    NAD+CA+TIR:172:20'
    DGS+IMD+3.2+2346+55:CEL'
    FTX+AAA+++SECOND,IS FAIR'
    similarly FTX+AAA should be concatenated if it has similar FTX+AAA IMMEDIATE below.
    The FTX+AAA segments can come any number of times immediate below
    Please help me how we can do this??? Can anyone help me with the code snippet to do this?
    Thanks,
    Kathir

    Encephalopathic wrote:
    You've posted > 300 times here and you still don't respect the rule regarding notification of all cross-posts? [http://www.java-forums.org/advanced-java/30061-how-extract-substring-string-based-condition.html]
    Do you think this this will help convince others to help you?See also [http://www.coderanch.com/t/500088/java/java/extract-substring-string-based-condition|http://www.coderanch.com/t/500088/java/java/extract-substring-string-based-condition].

  • Easily read strings while tracking the number of bytes read?

    Hi all,
    I'm after a way to easily parse and read strings from a file, while also being able to check (at any point) how many bytes have currently been read from that file.
    I currently use the following for the string processing:
    BufferedReader in = new BufferedReader(new FileReader(filename));
    String str = null;
    while ((str = in.readLine()) != null)
      // process the string
    }That's all fine, but the files I'm reading can be very large (multi GB) so obviously it can take a while to read them. During this time I pop up a progress bar, and attempt to track the progress of the read. The files I'm working with just now come with a header on the first line that states how many "somethings" (that I happen to be looking for) will appear in the file. I can use that number to set the maximum value for the progress bar, and update its current value as I find them.
    However... I'm also about to start working with files that don't contain this information. I've thought of two ways of knowing how much work has to be done in advance of the read so the maximum value for the progress bar can be set:
    1) Quickly count the number of lines in the file without doing any processing. This works, but can still take some time for large files, even with more efficient reading algorithms.
    2) Use File.length() to set the maximum to be the number of bytes that will read.
    I'd like to use 2), but can't work out a way to use simple String based file parsing (as in the code above), but also be able to know how many bytes have been read so far. Using this code means I don't have to worry about end of line terminators, charset encoding, etc - the Reader does it for me.
    Any suggestions?
    Thanks

    import javax.swing.*;
    Component parent; // might be null, or your JFrame
    String message; // message to display in the progress bar
    BufferedReader br = new BufferedReader(new InputStreamReader(new ProgressMonitorInputStream(parent, message, new FileInputStream(file)), charset));

  • Given a multi-line string I want to append a string constant to the beginning of each line.

    Thankyou.

    You could just use "search and replace" with the search string being "\n" (in \codes display) and the replace string as "constant\n". (See attached image).
    If the string you want at the beginning of each line is variable (e.g. line number), you should use e.g. "pick line" or "scan strings for tokens" in a loop, then rebuild the new string.
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    AppendConstant.gif ‏9 KB

  • Load a class based on the value of a string

    I have a string coming in into a servlet.
    I want to instaniate a class that is the same name
    as the string.
    A class exists for every possible value of the string.
    this is what my vision is.
    public ActionForward execute(
         ActionMapping mapping,
         ActionForm form,
         HttpServletRequest request,
         HttpServletResponse response)
         throws Exception {
         SubmitForm frm = (SubmitList)form;
         String classname = (String)request.getAttribute("listToEdit");
         //this is where the help is needed.
            //create an instance of the correct object.
            //pass it the form
            //class that objects execute method
         obj o = loadclass(classname);
            obj.setForm(frm);
            obj.execute();

    thanks steve , class.Forname is what i was looking for.
    I realized i need to cast it to the appropriate object and i was looking into that. You just solved it with the interface example.
    One more question.
    does my class have to implement the interface i create.
    public class TelephonNumbers implements ListEditInterface {
           private ActionForm form;
           public void setForm(ActionForm form) {
           this.form = form;}      
           public void execute(HttpServletRequest r) {
                  //get session bean
                  //update appropriate list in bean
                  //put the bean back into the request/session
                  //pass control back to action class.
    }

  • Need to change dimension member in context based on the member property

    Hi,
    When i select the one particular entity i.e. E_1100 , it having the currency property is INR, this currency has to change  the RPTCURRENCY dimension member i.e. INR. in the context member.
    Context is locked for the users.
    for example:
    In context i have Entity dimension, RPTcurrency dimension
                               E_1100               INR.
    In report user having the select parameter for the Entity Dimension. Now he has selected the E_1200  in the report , but it has currency property is USD
    now the RPT Currency dimension should have to display the  USD in the Context.
    Please anybody help me.
    Regards.
    Surya

    Hi Surya,
    you can achieve this using simple VBA code. Use below vba code for overriding the context member. assign this code to button. it will change the context member.
    Copy paste below code in one module and assign this code to the button.
    First Enable FPMXLClient
    Dim epm As New FPMXLClient.EPMAddInAutomation
    Sub change context()
    Dim CONNE As String
    CONNE = epm.GetActiveConnection(ActiveSheet)
    'To set context
    epm.SetContextMember CONNE, "CURRENCY", Range("A1")
    'To refresh
    epm.RefreshActiveWorkBook
    End Sub
    where CURRENCY==> use your dimension name whose context want to change
    Range("A1") ==> In A1 cell Populate property using EPMMemberproperty()
    Basically we will set context member and refresh the workbook.After selection of the entity click on button so macro will run and context member will gets override in the Context Bar.
    Regards,
    Sushant

  • I need to locate my iphone  4 someone stole it the number is 7043146128

    how do i track my phone

    You probably cannot.
    If you set up find my iphone on the iphone and it is on and the thief has not restored it, then you may be able to track using icloud.
    Otherwise you cannot.
    Report it to the police and change your passwords, and alert you carrier.

  • Extract portion of strings based on the positions

    Hi
    My requirement is simple.I get the below data from the source file.
    My data looks like this.Sometimes I get a space,one tab space,two tab space.It's ambiguous.
    FIRSTWORD SECONDWORD THIRDWORD FOURTH (o/p=FIRSTWORD SECONDWORD THIRDWORD)
    FIRSTWORD SECONDWORD THIRD WORD(o/p=FIRSTWORD SECONDWORD THIRD )
    If it is something fixed,then I can write using INSTR and SUBSTR and it worked.But how we can handle multiple cases all at a time.
    Thanks in advance
    KVB

    Perhaps something like this...
    SQL> ed
    Wrote file afiedt.buf
      1  with t as (select 'FIRSTWORD SECONDWORD  THIRDWORD FOURTHWORD' as txt from dual union all
      2             select 'FIRSTWORD       SECONDWORD THIRDWORD       FOURTHWORD' from dual)
      3  --
      4  -- end of data containing single or multiple spaces and/or tabs
      5  --
      6  select regexp_substr(txt, '[^ ]+', 1, 1) as first
      7        ,regexp_substr(txt, '[^ ]+', 1, 2) as second
      8        ,regexp_substr(txt, '[^ ]+', 1, 3) as third
      9        ,regexp_substr(txt, '[^ ]+', 1, 4) as fourth
    10* from (select regexp_replace(txt,'[[:space:]+]',' ') as txt from t)
    SQL> /
    FIRST           SECOND          THIRD           FOURTH
    FIRSTWORD       SECONDWORD      THIRDWORD       FOURTHWORD
    FIRSTWORD       SECONDWORD      THIRDWORD       FOURTHWORD

  • Sorting an array of Strings

    Okay, my first concern is that I'm pretty new to Java. It's my first language that I've ever looked at, and I'm just getting into it.
    I'm trying to read from a .txt file a name and an integer value associated with that name, like for instance, Jimmy Bob Jones 123. I have several lines of different names with different integers associated with each, sorted alphabetically in the .txt file to begin with. That's not the issue really--though I haven't figured out how to do that, I figure it's pretty simple compared to what I have to do with those. I set each line as a new element in an array of Strings, and then I want to sort them based on the value of the integer that follows each. I know that each integer is 5 digits, so I'm thinking about some way to sort based on Integer.parseInt(name.substring(name.length - 5, name.length)) for each element, but it's not coming to me.
    I mean, let's say I have the following in a .txt file:
    Abigail 32534
    Bo 28935
    Chris 45000
    Damian 13777
    And I feed those into my .class and set each line to an array element, so it would be like arrayName[0] = "Abigail 32534" etc. for each. Convoluted question, sorry. How would I sort those strings based solely on the integer values, yet also retain the name that goes along with it?
    Any help is appreciated, though I don't guarantee I'll understand : )

    One easy (such a relative term) way is to create an Object, such as NameAndNumber, which has two member variables (name and number). When you read in your file, create objects of this type.
    As for the sorting, this is a two step process:
    1) Create a Comparator class to compare your objects
    2) Populate a TreeSet which uses this comparator.
    The TreeSet will be sorted automatically (based on your Comparator) and you can then iterate through it to retrieve instances of your object.
    This all sounds much more complicated than it is. I have written some code to get you started.
    // Your class
    public class NameAndNumber {
      private int m_nNumber;
      private String m_sName;
      // sets the name
      public void setName(String sName) {
        m_sName = sName;
      // gets the name
      public String getName() {
        return m_sName;
      // sets the number
      public void setNumber(int nNumber) {
        m_nNumber = nNumber;
      // gets the number
      public int getNumber() {
        return m_nNumber;
    // Your comparator
    public class MyComparator implements Comparator {
      // required by interface
      public int compare(Object obj1, Object obj2) {
        // throws ClassCastException if there is a problem - you will need to add
        // handling if this is an issue
        NameAndNumber objNan1 = (NameAndNumber) obj1;
        NameAndNumber objNan2 = (NameAndNumber) obj2;
        // will return the proper comparison based on the number
        return (objNan1.getNumber() - objNan2.getNumber());
    // Inside your "main" class
    TreeSet setNumbers = new TreeSet(new MyComparator());
    NameAndNumber objNameAndNumber = getNextListing(); // you need to provide this method, which gets the items one at a time
    setNumbers.add(objNameAndNumber);Hope this helps.

  • Need help Sorting an Arraylist of type Object by Name

    Hey guys this is my first time posting on this forum so hopefully i do it the right way. My problem is that i am having difficulties sorting an Array list of my type object that i created. My class has fields for Name, ID, Hrs and Hrs worked. I need to sort this Array list in descending order according to name. Name is the last name only. I have used a bubble sort like this:
    public static void BubbleSort(TStudent[] x){
    TStudent temp = new TStudent();
            boolean doMore = true;
            while (doMore) {
                doMore = false;
                for (int i=0; i < x.length-1; i++) {
                   if (x.stuGetGPA() < x[i+1].stuGetGPA()) {
    // exchange elements
    temp = x[i]; x[i] = x[i+1];
    x[i+1] = temp;
    doMore = true;
    before many time to sort an array of my class TStudent according to GPA.  This time though i tried using an Array list instead of just a simple array and i can't figure out how i would modify that to perform the same task.  Then i googled it and read about the Collections.sort function.  The only problem there is that i know i have to make my own comparator but i can't figure out how to do that either.  All of the examples of writing a comparator i could find were just using either String's or just simple Arrays of strings.  I couldn't find a good example of using an Array list of an Object.
    Anyways sorry for the long explanation and any help anyone could give me would be greatly appreciated.  Thanks guys
    Edited by: Brian13 on Oct 19, 2007 10:38 PM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

    ok still having problems I have this line of code to try and all Arrays.sort
    Arrays.sort(Employee, TEmployee.FirstNameComparator);Then in my class TEmployee i have
    public static Comparator FirstNameComparator = new Comparator() {
        public int compare(Object employee, Object anotherEmployee) {
          String lastName1 = ((TEmployee) employee).getEmpName().toUpperCase();
          String lastName2 = ((TEmployee) anotherEmployee).getEmpName().toUpperCase();     
           return lastName1.compareTo(lastName2);
      };Here is the rundown of what i have for this. I have 2 classes. One is called TEmployee and that class holds fields for Name, ID, Hrs Worked, Hourly Rate. Then i have another class called myCompany that holds an ArrayList of type TEmployee. Then i have my main program in a Jframe.
    So maybe i am putting them in the wrong spots. The code in TEmployee thats make the comparator is fine. However when i try to call Arrays.sort from class myCompany i get this
    cannot find symbol
    symbol: method sort (java.util.Array list<TEmployee>.java.util.Comparator
    location: class java.util.Arrays
    I have to put the comparator in TEmployee right because thats where my fields for Name are? Do i call the arrays.sort from my main program or do i call that from the class myCompany where my ArrayList of TEmployees are stored?
    Again guys thanks for any help you could give me and if you need any code to see what else is going on just let me know.

Maybe you are looking for

  • Export from LR to PS no longer works

    I just updated to Camera Raw8.3 and now when I'm in LR5.3 and attempt to edit an image in PS5, the image does not move from LR to PS. Should I just go back to a previous CR version?

  • Sub tab refresh

    Hi, I have added new tab to seeded page in Sourcing module. In Quote RFQ page, there are two tabs Headers and Lines, I added new tab Capability. This new tab should display the RFQ lines which are not quoted ie for which price is null or zero. If a l

  • SD Condition only for position type??

    Hi everyone!! I have a discount condition for a customer. In the same sales order, I have this: Position type A +10 UNITS Discount 2% Position type B -1 UNITS Discount 2% (This is a mistake!!) How could I customize to eliminate this condition when it

  • Uncaught exception: Static initializer: java/lang/SecurityException

    So i'm trying to compile some code of a small game for Doja. The code compiles fine but when i load it in the emulator i get the following eror: Uncaught exception java/lang/Error: Static initializer: java/lang/SecurityException. Now i haven't seen t

  • Why has autofill stopped working?

    I recently upgraded to OS 10.8.5 and autofill has stopped working.  How can I get it to work again?