Is it possible to sort by word count

I have a list of titles and wish to arrange them by the number of words in each title, any suggestions gratefully received

Hi FF,
Word processing applications usually define a 'word' as a group of characters followed by a space (or a return).
I haven't foud a way to directly count the number of spaces in a string of text, but Numbers does support FIND() which can determine the position of a specific character's first appearance in a string or after a specified position in a string.
That's the method used in the coloured cells of the table below.
C2: =IFERROR(FIND(" ",$B,1+MAX($B2:B2)),"")
Fill right for as many cells as there are words in the 'longest' title.
Fill down to the end of the table.
A count of the cells containing numbers in the row (not including the cell in A, which must be a Header column) will give the number of spaces in the title. Add 1 for the number of words in the title.
A2: =IF(LEN(B)>0,COUNTIF(2:2,">0")+1,"")
Fill down to the last row in the table.
Sort on column A to arrange the titles by length in words.
Note the results in rows 5 and 6.
Row 5 contains the title of Paul Zindel's 1964 play as he wrote it. Man-in-the-Moon is considered as a single word in the count.
Row 6 contains the same title with the hyphens replaced by spaces. Man in the Moon now counts as 4 words.
Rows 7 and 8:
George Orwell's title is read as a number. As it's greater than 0, the number is included in the count. 1 is added to account for there being no space after the 'last word' in the title to give a count of 2. (Result is the same when the title is entered as '1984 (the leading ' tells Numbers, and other spreadsheets, to format the cell as text), of when the cell's format is set to Text using the Inspector.)
In row 8, 1984 is enclosed in quotation marks, and is now treated as text (with a numerical value of zero).
As noted, the columns doing the calculations may be hidden.
Regards,
Barry

Similar Messages

  • Is it possible to limit the size of a text box by word count?

    I know that it is possible to use a character limit but most users prefer a word limit as they feel it is a more meaningful restriction rather than punishing those that use long words!
    Is there some way to apply a word count limit on a text field in Designer?

    Thanks Elaine, I did find a a few scripts like this online but none of them were geared toward people using LCD to create forms.  The one you've posted is the simplest one I've seen and  I've adapted the script form the example you provided but have had a blank on how to call the script object using a click event on a button.
    So far I have
    function countWords()
                           form1.test.countText.rawValue = form1.test.enterText.rawValue.split(' ').length;

  • Is it possible to display word count or character count in selected text

    The Word Count utility counts all words in the document. Is there a way to count the number of characters or words in a piece of selected text?

    re: Is there a way to count the number of characters or words in a piece of selected text?
    Until you get an answer you like better, with the text highlighted, right-click, copy, paste into empty LibreOffice Writer document:
    Tools > Word Count

  • Is it possible to sort text/imessages in alphabetical order??

    Is it possible to sort text/iMessages into alphabetical order instead of just by date??  Would be great to have the option to sort by different filters or even to initiate a search of a particular subject/word or persons name.

    Didnt think so.  APPLE!!!  Would be good to have please!!!

  • RE: Is it possible to sort tags?

    This is a continuation of the Support Forum question titled: “Is it possible to sort tags?” located at:
    https://support.mozilla.org/en-US/questions/963133?esab=a&as=s&r=2&page=1
    If this new topic has to be posed as a new question the following applies.
    If you visit the above link you will learn how convoluted were the solutions provided to non-programmers.
    I CERTAINLY EXPECTED THAT BY NOW there would have been an effort to address the Tag sorting issue, since there have been a number of upgrades since this question was first posted. Tag sorting provides a much more robust browser many more would choose to use. It would also attract more users concerned about the control on our liberties if supplied with a browser that truly has more powerful capabilities to garner and access information.
    One of the points the Firefox Team uses to attract more to use it is the protection it gives from snoops. You’ve got to ask yourself how much protection that might be if developers can’t do something simple (for talented programmers) like provide tag sorting. That comment is from, basically, a non-programmer, so I have no idea how much code would have to be written to bring this about. I suspect they don’t either and possibly fear the effort might turn out to be much greater than it really is.
    It’s been a LONG time since I used Internet Explorer by Microsoft. What brought me to Firefox was their mission statement to provide access free of its own brand of commercialism and free usage of the Internet, which also implied an effort to protect privacy. For the same reasoning I would not use Google, after reports of their cooperation with government heads in China. Reports have also surfaced that Microsoft has provided a back-door to the NSA for their Internet Search engine, all of this in total disregard to the US Constitution’s 4th Amendment requiring a warrant from a court to prevent unreasonable searches and seizures. I would, however, wish that Firefox would OPENLY adhere to the Bill of Rights in their Privacy Policy, which is not stated in so many words. Many would say, “I don’t have anything to hide, so I don’t care.” Apparently they are unaware how dirty politics and politicians can be. This is the reason why a viable alternative, such as Firefox, is so important.
    If you wish to learn more about just one individual who has dedicated his life in service to this country in terms of providing liberty to the widest possible number along with a promise to use the wealth he has built throughout his life (except for the necessity of living in exile), visit the following:
    http://wantarevelations.com/wanta-black-swan-white-hat/
    This is just one of the links that would be a lot easier to access, were it possible to sort Tags.
    Is this off-topic? Not really.

    HI MozillaFirefoxNewbie,
    Thank you for your question, even though this is not off topic, the points made would have a better audience in a feature proposal in Bugzilla. Please check out the features and description here:
    [https://bugzilla.mozilla.org/enter_bug.cgi?product=Firefox&component=Bookmarks%20%26%20History]
    As mentioned in the previously posted thread, there was a work around provided by [https://support.mozilla.org/en-US/questions/963133#answer-462676 jscher] that sounded functional.
    However if there is no extension desired, I encourage to proved the steps and objective of the feature.
    If you open up the Bookmark Library however and click the drop down of 'Tags', they are in alphabetical order.
    Have you tried this built into Firefox?
    Cheers

  • How do I get a word count in Pages 5.5.2?

    I have a 21.5" iMac, bought December, 2014. I have Yosemite 10.10.2 installed and I am using Pages 5.5.2.
    How do I get a Word Count in Pages 5.5.2?

    View menu > Show Word Count.
    A floating panel will appear at the bottom of your document. Pass your mouse over the right-side of this floating panel and you will see up/down arrows. Click. Choose Word count from the list of available counts. The floating panel now displays word count, until you change it again. You can also move this floating panel with a command+click+drag, in case you want it below your footer content.
    You might want to download the free WordService service solution from the OS X App Store. I provides you with many additional features (e.g. Sort Ascending, Document Statistics, etc.) The act of downloading this application will install, but not activate several services. You activate what you want in:
    System Preferences > Keyboard > Shortcuts > Services : WordService:servicename.
    The WordService application will be in your LaunchPad (on your left Dock). Run it and choose Help. This will launch the Preview PDF viewer and a document showing all the Services available, and their description. Services in OS X act on selected document content. If you want more detail on the number of words, characters, and spaces in a selected paragraph, you would use Pages > Services > WordService:Statistics.

  • Why is the word count different when I use word count from the tools menu to the number at the bottom of my mac word document

    Why is the word count different when I use word count from the tools menu to the number at the bottom of my mac word document

    This forum is for Apple's defunct office suite 'AppleWorks' - since the word count is not in the places you mention I assume you are talking about Microsoft Word? Though it's just possible someone in this forum might also use Word and know the answer, you would stand a higher chance of getting an answer in Microsoft's own forums. You could also try asking in the forum applicable to your operating system - Lion, Mavericks or whatever - on the reasonably chance of finding someone familiar with Word.

  • Is it possible to sort textframes in alphabetical order?

    Hi,
    I have a large number of separate text frames with text startsing with a number.
    Is it possible to sort the text frames i alphabetical / numeric order either in y or z?
    Scripts available that I've found sort paragraphs, but since my text frames contains several paragraphs that's not an option.
    InDesign CS5, MacOS X.
    So, help much appreciated.
    /K

    That took me a few minutes
    Sorting 'on contents' is easy, but then the text order inside the frames as set would be correct, but not the order of the frames themselves. The top frame on your screen may not be "the first one" according to the order of creation.
    So you also have to re-sort the text frame location, top to bottom and left to right. I do this by first sorting the frames into the correct location, so the "first" frame is actually the first one on the page, then the next one etc.
    Then I sort the contents on the first word and move the frames around into their sorted order.
    I do this quick 'n dirty: by moving their geometric bounds around. Thus it's possible I place a large text into a small 'original' frame (actually I don't move the text around) and it might get overset. But this way nothing else on the screen changes.
    If you want the frames aligned and spaced out as in your "below" image, you could do that before running my script.
    Is this what you were looking for?
    list = app.selection;
    org_order = [];
    for (i=0; i<list.length; i++)
    org_order[i] = list[i].geometricBounds;
    org_order.sort (function(a,b) {
    if (a[0] == b[0]) return a[1] - b[1];
    return a[0] - b[0];
    list.sort ( function(a, b) {
    return parseInt(a.texts[0].words[0].contents) - parseInt(b.texts[0].words[0].contents);
    for (i=0; i<org_order.length; i++)
    list[i].geometricBounds = org_order[i];

  • How can I get a word count in iCloud Pages Beta?

    Apparently there is no way to get a document word count in iCloud Pages Beta.  Has anyone figured out a work around for this?

    View menu > Show Word Count.
    A floating panel will appear at the bottom of your document. Pass your mouse over the right-side of this floating panel and you will see up/down arrows. Click. Choose Word count from the list of available counts. The floating panel now displays word count, until you change it again. You can also move this floating panel with a command+click+drag, in case you want it below your footer content.
    You might want to download the free WordService service solution from the OS X App Store. I provides you with many additional features (e.g. Sort Ascending, Document Statistics, etc.) The act of downloading this application will install, but not activate several services. You activate what you want in:
    System Preferences > Keyboard > Shortcuts > Services : WordService:servicename.
    The WordService application will be in your LaunchPad (on your left Dock). Run it and choose Help. This will launch the Preview PDF viewer and a document showing all the Services available, and their description. Services in OS X act on selected document content. If you want more detail on the number of words, characters, and spaces in a selected paragraph, you would use Pages > Services > WordService:Statistics.

  • How can I use word count without it counting the words in the end notes by default?

    How can I use word count without it counting the words in the end?
    Now I have to highlight the text to get a count.

    I don't think that is possible, it does what it does.
    Peter

  • Array words count

    Hi guys
    This code is giving me this output
    The New York Times is an American daily newspaper founded and continuously published in New York City since September 18 1851 It has won 112 Pulitzer Prizes more than any other news organization 0
    I need to read and split the array (I believe that part works)
    I also need to count the words and display it like this
    The(1)  New(2) York(2) Times(1) is (1) ...etc
    I am   System.out.print(token + " "  ) ; then I need to count the words and display the number in front
    Thank you
    package test4;
    import java.util.StringTokenizer;
    * @author rechever
    public class Test4 {
         * @param args the command line arguments
        public static void main (String[] args) {
           System.out.println("Displaying a paragraph: ”): ");
                String sentence1 = "The New York Times is an American daily newspaper, founded and continuously published "
                        + "in New York City since September 18, 1851. It has won 112 Pulitzer Prizes, more than any other news organization";
        //        String sentence1  = scanner.nextLine();
          /* regular expression   */
          sentence1 = sentence1.replaceAll("\\,"," ");
          sentence1 = sentence1.replaceAll("\\."," ");
          sentence1 = sentence1.replaceAll("\\;"," ");
                StringTokenizer stt = new StringTokenizer(sentence1," ");
              // int countWords = 1;  
                while
                    (stt.hasMoreTokens()){
                    String token = stt.nextToken();
                   System.out.print(token + " "  ) ;
                 // String  value = sentence1;
                 //  String value = token;
              //  insertNode(value);
              //  insertNode(value);
                for(int countWords = 0; countWords < sentence1.length(); countWords++ ) {
           if(sentence1.isEmpty()) {
             System.out.println(countWords);
                } // end of Main  

    Believe I try before I ask, if you see the code I was able to split the array, I am having problems with the counts and displaying the results in front of the words..
    as you can see I initiated the loop, I just can not get it to work...
    for(int countWords = 0; countWords < sentence1.length(); countWords++ ) {
           if(sentence1.isEmpty()) {
             System.out.println(countWords);
                } // end of Main 
    I need to able to split the array
    StringTokenizer stt = new StringTokenizer(sentence1," ");
              // int countWords = 1;  
                while
                    (stt.hasMoreTokens()){
                    String token = stt.nextToken();
                   System.out.print(token + " "  ) ;
    then after the array split I need to counts the words,
    this 
    for(int countWords = 0; countWords < sentence1.length(); countWords++ ) {
           if(sentence1.isEmpty()) {
             System.out.println(countWords);
    is not doing the trick..
    I am in the business of learning, I am not looking for a free ride...I google it, I look in books
    This code is doing it but I have to call a method to insert the array in a Binary tree
    something like tree.insertNode (value)
    being value the data stoom the split array....
    Now if you want to give some ideas (a link, documentation anything of how to call a method from  a class that is using maps...that will be great
    I though that doing it in a simple array was easy... again, I just learning
    Thank you
    import java.io.PrintStream;
    import java.util.*;
    public class WordTypeCount
       public static void main( String[] args )
          // create HashMap to store String keys and Integer values
          Map< String, Integer > myMap = new HashMap< String, Integer >();
          createMap( myMap ); // create map based on user input
          displayMap( myMap ); // display map content
       } // end main
       // create map from user input
       private static void createMap( Map< String, Integer > map )
          Scanner scanner = new Scanner( System.in ); // create scanner
          System.out.println( "Please Enter the sentence from the the from Edgar Allen Poe’s “Fall of the House of Usher”):" ); // prompt for user input
          String input = scanner.nextLine();
          // tokenize the input
          String[] tokens = input.split( " ");
          // processing input text
          for ( String token : tokens )
             String word = token.toString(); 
                     ///toLowerCase(); // get lowercase word
             // if the map contains the word
             if ( map.containsKey( word ) ) // is word in map
                int count = map.get( word ); // get current count
                map.put( word, count + 1 ); // increment count
             } // end if
             else
                map.put( word, 1 ); // add new word with a count of 1 to map
          } // end for
       } // end method createMap
       // display map content
       private static void displayMap( Map< String, Integer > map )
          Set< String > keys = map.keySet(); // get keys
          // sort keys
          TreeSet< String > sortedKeys = new TreeSet<  >( keys );
          System.out.println( "\nMap contains:\nKey\t\tValue");
          // generate output for each key in map
          for ( String key : sortedKeys )
          // System.out.printf( "%-10s%10s\n", key, map.get( key ) );
          System.out.printf( "%-5s%-5s", key,map.get( key ) );
         // System.out.printf("\nsize: %d\nisEmpty: %b\n", key, map.get( key ) );
          System.out.printf(
             "\nsize: %d\nisEmpty: %b\n", map.size(), map.isEmpty() );
       } // end method displayMap
    } // end class WordTypeCount
    Thank you

  • Word Count?? Anywhere? Please?!

    I just recently switched from Windows to Mac. I love this new word processing program, but I can't seem to find one key tool that Microsoft Word has - the word counter!! Does Pages have a word counter?? Please help, I need this for school! Thanks everyone:)
    Also, does anyone know how to change your alias on this discussions board? The name I chose was a bit impulsive, and I'd like to go with a different one if possible! Thanks again~
    <3D

    Welcome to Apple Discussions, Weezy's Deezy!
    Does Pages have a word counter??
    Yes, see this thread:
    http://discussions.apple.com/click.jspa?searchID=7127794&messageID=6520088
    Also, does anyone know how to change your alias on this discussions board?
    It is not possible. Apple has chosen to lock you in to a single alias. If you want to use a different one, stop using this account and set up a new one. Sorry.

  • Selective word count

    Hey folks,
    Does anyone know if it's possible to have Pages do a word count of part of a document - i.e. if I select a block of text from the whole, can I find out the word count of just that block without having to cut and paste?
    Thanks
    MacBook 13" 1.83GHz   Mac OS X (10.4.7)   1 Gb, 60 Gb HD

    No, unfortunately. But you can install Devon Technologies free WordService product to get statistics about selected text.
    <http://www.devon-technologies.com/products/freeware/services.html>
    Please do send Apple feedback that you'd like this added to Pages 3.
    <http://www.apple.com/feedback/pages.html>
    Cheers.
    Dale

  • Word Count Method?

    Hey all. I am having a bit of an issue. I need to write a program to read a file and count how many words are in the file. So far I have the basis for the while loop to read a line from the file, but I can't seem to figure out how to code the loop to count the words. Java doesn't have a word count method does it? I have looked, but have been unable to find anything of the sort.
    I don't want you do do this for me, I just need some helpful hint/tips. Anything you can provide is appreciated. Thanks!

    I am now having this problem. Here is a code segment:
    void count(String newFileName) throws IOException
              fileName = newFileName;
              FileRead file = new FileRead(fileName);
              wordCount = 0;
              StringTokenizer st = new StringTokenizer(fileName);
              while (file.getLine() != null)
                 while ( st.hasMoreTokens() )
                    st.nextToken();
                    wordCount++;
         }I think it should be changed to StringTokenizer st = new StringTokenizer(file) but when I do so, I get the error "The constructor StringTokenizer(FileRead) is undefined". I assume this is because file is an object not a String variable. the current code has a problem because it only returns 1. Any ideas?
    Edited by: zcrane on Nov 1, 2007 3:40 PM

  • Adapting My Word Counter Program to also Search and Replace

    Hi,
    I recently completed a word counter program for a school assignment. It reads in a file name from the command line and prints the contents to the screen before counting the number of words. i now want to try and adapt this program to also search for and replace a word specified by the user and print the document back to the creen with the changes. it would work something like this:
    java SearchReplaceApp test.txt
    This is a test
    This is a test
    This is a Test
    This is a Test
    This file contains 16 words
    Search for?: test
    Replace with?: Test
    This is a Test
    This is a Test
    This is a Test
    This is a Test
    Search for?:
    etc..........
    I was planning on using the replaceAll method and obviously i would neeed some kind of loop structure (probably a do/while loop) but i dont really know how to implement this in this scenario.
    Any suggestions would be appreciated. NEWBIE ALERT!!!!!! im afraid as i have very little programming experience, so please keep it as simple as possible please.
    maybe i'll give you a hug or something

    Just to make it easier for you guys to understand heres the code i have for my word counter, which i have now renamed SearchReplaceApp:
    import java.io.*;
    import java.util.*;
    class SearchReplaceApp
                public static InputStreamReader input =
                                       new InputStreamReader(System.in);
                public static BufferedReader keyboardInput =
                                       new BufferedReader(input);
                public static void main(String[] args) throws IOException
                                      FileReader file = new FileReader(args[0]);
                                      BufferedReader MyFile = new BufferedReader(file);
                                      StringTokenizer TokenizeMe;
                                                int NumberOfTokens = 0;
                                                int NumberOfWords = 0;
               TokenizeMe = new StringTokenizer(MyFile.readLine());
               NumberOfTokens = TokenizeMe.countTokens();
               while (NumberOfTokens != 0)
                                        for (int WordsInLine=1; WordsInLine<=NumberOfTokens;
                                                                        WordsInLine++)
                                                     System.out.print(TokenizeMe.nextToken()+" ");
                                        System.out.println();
                                        NumberOfWords += NumberOfTokens;
                                        String line = MyFile.readLine();
                                        if (line==null) break;
                                       TokenizeMe = new StringTokenizer(line);
                                       NumberOfTokens = TokenizeMe.countTokens();
                 System.out.println("\nThis file contains " + NumberOfWords + " words");
                 MyFile.close();
    }as you can see it does use a tokenizer, i would ideally like to be able to replace parts of words as well as whole words and also prompt for another search word after displaying the updated file e.g.
    This is a test
    Search for?: is
    Replace with?: was
    Thwas was a test
    Search for?:
    im really quite stuck on this so suggestions of any kind are welcome
    thanks

Maybe you are looking for

  • Excise Invoice- Based on Billing Plan

    Dear All, Here in my client's place, we have a requirement like, For a project-XYZ we create one sales order with materials A,B & C. For this sales order we maintain billing plan 50% = X1 Rupees ,                                                      

  • Problem with Tab Key in JFileChooser when Details view is selected.

    Hi all, Iam using a JFileChooser in my application.When i click Details option in the JFileChooser the files with the size,Type and modified date are displayed. When i am using tab to navigate through the JFileChooser,when the tab enters the area whe

  • Connect MBP to web via usb tether to iphone

    connect book to web via iPhone with usb

  • Another SUS Query

    HI All, We are working on the MM-SUS classic scenario. Currently the supplier is creating invoice based on the ASN. But as per the standard scenario we should be able to create invoice based on ASN & PO. How do I enable the functionality of creating

  • How do you make the strip silence window larger!!

    How can I adjust the strip silence window to make the wave files larger so I can see my adjustments better.... Right now they're so small I can't tell what I'm doing.. Thanks RD