Finding cells containing numbers and applying a cellstyle.

i need to find every cell that has just a number in it and apply certain cell style, can anyone help me with a js code for this?

guh....
just in the last month or so there were at least 3 threads on similat matters.
here is a quick and dirty one for all the document
function main() {
          var doc = app.activeDocument;
          app.findGrepPreferences = app.changeGrepPreferences = null;
          app.findGrepPreferences.findWhat = "\\A\\d+\\Z"
          var myF = doc.findGrep(),
                    l = myF.length;
          while (l--) {
                    if (myF[l].parent.constructor.name == 'Cell') {
                              myF[l].parent.appliedCellStyle = 'NameOfYourCellStyle';
                              //optional clear the cell overrides, comment out next line if not needed
                              myF[l].parent.clearCellStyleOverrides()
          alert('All done!\nYou can go outside an play now!')
app.doScript('main()', undefined, undefined, UndoModes.entireScript, 'Apply Cell Style to Nr')

Similar Messages

  • Finding missed sequence numbers and rows from a fact table

    Finding missed sequence numbers and rows from a fact table
    Hi
    I am working on an OLAP date cube with the following schema:
    As you can see there is a fact transaction with two dimensions called cardNumber and Sequence. Card dimension contains about three million card numbers. 
    Sequence dimension contains a sequence number from 0 to 255. Fact transaction contains about 400 million transactions of those cards.
    Each transaction has a sequence number in 0 to 255 ranges. If sequence number of transactions of a card reaches to 255 the next transaction would get 0 as a sequence number.
    For example if a card has 1000 transactions then sequence numbers are as follows;
    Transaction 1 to transaction 256 with sequences from 0 to 255
    Transaction 257 to transaction 512 with sequences from 0 to 255
    Transaction 513 to transaction 768 with sequences from 0 to 255
    Transaction 769 to transaction 1000 with sequences from 0 to 231
    The problem is that:
    Sometimes there are several missed transactions. For example instead of sequence from 0 to 255, sequences are from 0 to 150 and then from 160 to 255. Here 10 transactions have been missed.
    How can I find all missed transactions of all cards with a MDX QUERY?
    I really appreciate for helps

    Thank you Liao
    I need to find missed numbers, In this scenario I want the query to tell the missed numbers are: 151,152,153,154,155,156,157,158,159
    Relative transactions are also missed, so I think it is impossible to get them by your MDX query
    Suppose this:
    date
    time
    sequence
    20140701
    23:22:00
    149
    20140701
    23:44:00
    150
    20140702
    8:30:00
    160
    20140702
    9:30:00
    161
    20140702
    11:30:00
    162
    20140702
    11:45:00
    163
    As you can see the sequence number of the last transaction at the 20140701 is 150
    We expecting that the first transaction of the next day should be 151 but it is 160. Those 10 transactions are totally missed and we just need to
    find missed sequence numbers

  • Finding cells in Numbers?

    I have a list of names in different cells in numbers and I want to identify certain names with totals in them. How can i do that? Like the cells might have names like bob in one carol in one sandy in one and I want to find all of the Bob cells.
    Does this make sence?
    Thanks

    I do want to sum up the cells. The cells that I want to do it with are mixed in the list of other cells.  Column a has the  different names in each cell. Column c has the dollar amount. I want to be able to sum all of a certain name in column a.
    Thanks

  • Find/Change Item Numbers and create Table of Contents

    Hello! I need help to find all my item numbers and apply a paragraph style to it so I can use them to create a Table of Contents page.
    Sample item numbers
    #12345
    #12345-5
    #12345-20
    #12345-ABC
    #12345/N
    I tried entering #^?^?^?^?^? on the Find/Change box and but this will find exactly the 5 characters after the # sign. I wonder if you can find all characters starting with # and until the last characters.
    Once I find all the item numbers, how can I apply the paragraph style for only those characters after the # sign? Because I only want to show the item numbers without the # sign on the Table of contents/Index page.
    By the way, I have InDesign CS2 which have no GREP function Maybe I can do this without the GREP?
    I really appreciate any help. Thank you very much.

    You actually have two problems here. The first is to assign the paragraph style. For that you can use GREP.
    Find #\d+ and leave the change field blank, but in the change formatting pick the paragraph style. Stricly speaking you only need to find #\d or even just # because a paragraph style applies to an entire paragraph, so assigning it to any character inthe paragraph will assign it to the entire paragraph.
    Which is your second problem. The TOC is based on paragraph styles and will include all of the text in each paragraph (up to the character limit for a TOC entry, which I think is 256 characters). You can't make a TOC and only use some of the paragraph. For that you need to use an index, or you need to make hidden or non-pinting frames with only the exact text you want in the TOC and assign a unique style to those.
    It's also possible someone has written (or could write) a script that can find text strings that match a pattern such as your numers, assign a character style to them (you could actually do that part in the paragraph style by adding a nested GREP style), then making a list of the text strings along with the page number on which they appear -- almost the same as an index except it would be based on character style, not an index marker.

  • How do i keep only the name of a month in a cell in Numbers and not have it auto fill the date and time?

    how do i keep only the name of a month in a cell in Numbers and not have it auto fill the date and time?

    Hi JN and Barry,
    Barry wrote:
    The second case may not be included in the available D&T formats in Numbers 3
    For my region, the Date & Time data formats include month.
    The Date Pop-Up
    This may not be the case for all regions.
    Remember that the month is only the display, and the Full Date & Time is still there. If I change the format to reveal what is behind the curtain:
    Regards,
    Ian.

  • After updating numbers and pages I can no longer copy multiple cells from numbers and paste and match style to pages.

    After updating numbers and pages I can no longer copy multiple cells from numbers and paste and match style to pages.  I used to be able to select multipule cells in a row (such as company name, address, etc.) then paste and match style on to a pages letter. I found the paste and match style option in the edit menu, however it will only work one cell at a time. Before the update is was working great.

    For diagnosing purpose thy the procedure in a new user account and see if it works there. You create a new user account in the System Preferences > Accounts. If it works in the new account it is probably a corrupt plist file that needs to be deleted.

  • Adding Cells with numbers and text

    I am a real newbie at formulas - so if there is an obvious answer I am sorry.
    I am looking to add week numbers for a custom calendar. So in one cell I have Week 1. I am looking to have the following week add 1 to that - but keep the text Week - so we get Week 2. How can I easily go about this? Thanks

    That was interesting!
    The most difficult part was getting the calendar to recognize the closing days and make the necessary adjustments. Here's the result for September calendar, with the school year starting September 1 to demonstrate the effect of a closing day inserted after the year begins. (One fitting your year is shown below.)
    The small table to the right, "No School" is a one column table listing, in order, the dates (not including Sundays) on which the school will be closed. For periods where the school is closed for 2 or more consecutive days, each day must be included in the list. The table has two header rows and one footer row. As written, the formulas using this table require A1 to contain a non-date value, A2 to contain the date of the day before the first day of school—in the example, August 31, 2011; in your case, September 5, 2011, and the Footer row to contain a date after the last day of school.
    The cell displaying the month name, and all cells showing a day number, contain a Date and Time value, with the display determined by two Custom formats, set using the Cell Format inspector. The contents of the cells are used in calculations, and must be Date and Time values, not numbers.
    Row 1 is a header row.
    The full date for the first of the month to be shown is entered into the center cell in row 1. (This is a merged cell formed from the three cells C1, D1 and E1. Formulas using the value refer to it as C1.)
    G1: =EOMONTH(C1,0)
    This returns the date for the last day of the month of the date in C1. The date is used in a conditional formatting rule in the last row of the calendar. It can be hidden by setting the text color of this cell to match its background fill color (white).
    Row 2 is a header row, containing the names of the days of the week, using the Sunday to Saturday arrangement to match the illustration linked by the OP. A different starting day will require revisions to some formulas.
    A3: =C1-WEEKDAY(C1,2)
    This formula calculates the date of the last Sunday before the date in C1. If you don't like the fact that the "2" displays as "Monday is 1", the version below will produce the same result, with the second argument displaying as "Sunday is 1"
    A3: =C1+1-WEEKDAY(C1,1)
    B3: =A+1
    Adds 1 (day) to the date in A1. Fill this formula Right to column G.
    Select all cells in row 3 and format as Custom, Type: Date and Time, and including only the Day of Month element.
    B4: =(IF(MATCH(B3,No school :: $A,1)=MATCH(B3,No school :: $A,-1),"closed",("Week "&QUOTIENT(DATEDIF(No school :: $A$2,B3,"D")-MATCH(B3,No school :: $A,1),7)+1)))
    Fill this formula from B4 to G4. (Note that there is no entry in A4)
    At its heart, this is an IF statement that returns "closed" if the date in the cell above it is on the closed list or the text "Week n" if that date is not on the list.
    The first MATCH statement matches the 'largest' date less than or equal to the test date (in B3); the second matches the 'smallest' date equal to or more than the test date (in B3). If the date is on the list, both of the two MATCH statements will return the same value, and IF will return "closed".
    If the date is not on the list, the two MATCH statements will return different values, and IF will pass control to the "if false" part of the formula (everything following "closed", ).
    DATEDIF calculates the number of days since the first day on the No School list and subtracts the number of 'no school' dates in that time, using MATCH), then finds the Quotient when that number is divided by 7 (days in a week) and adds 1 to determine the week number. The concatenation operator ( & ) tacks that number to the end of the text string "Week " and returns the result.
    As can be seen in the Monday and Tuesday cells in row 4, the formula will return an error message (MATCH was unable to find...) if the date is earlier than any on the table. To eliminate this, insert IFERROR between the = sign and the parenthesis at the beginning of the formula, and ,"" (comma-quote-quote) between the last and next to last parentheses at the end. This is necessary ONLY on the first date row of the September calendar, so the change can be delayed until you have made a duplicate of the completed calendar table.
    Next, Select rows 3 and 4, then drag the Fill handle down two rows to copy all formulas into rows 5 and 6. Although the results may look correct, you should replace the formula in A5 with the one below:
    A5: =A3+7
    With that change made, select rows 5 and 6, then Fill down to rows 11 and 12.
    Conditional format rule: A3 - F3
    Set the rule: With Dates  Before the Date  C1
    Conditional format rule: A11 - G11
    Set the rule: With Dates  After the Date  G1
    The default format for both these rules is the grey text shown for the August and October dates on the September calendar.
    For months where another row of dates is needed, use the Add/Delete rows handle at the lower left of the active table to add two rows, select rows 11 and 12, and fill down. The filled cells will include the formatting set here.
    To create calendars for the rest of the months, select the table icon for the one completed, press command-D to duplicate it, move it to a free location, then enter the date for the first day on the month you want into cell C1 of the new calendar. Here's the result for May, 2012:
    And here's the September calendar fitted to your school year beginning on September 6, with no other closings in September (and with the error trap mentioned above applied to the first week of dates).
    Regards,
    Barry
    PS: email me directly for a copy of the file. Address available by clicking my name.

  • Table for finding the SHC numbers and PO numbers

    Hi Guys,
    Can anyone tell me where I can find the SHC number and PO number getting updated in one table.
    Also If I wanted to have both the data what should I have to do?
    Regards
    Srujank

    Hello Srujank,
    You can use
    1. Report : BBP_BW_SC2: Monitor shopping cart status
    2. From Table :  CRMD_ORDERADM_I get the SC item GUID & use this GUID in table BBP_PDBEI to get the follow on document (PO) number.
    Hope this helps.
    Thanks
    Ashutosh

  • Find & Replace the text and apply paragraph style in indesign CS2.

    Hai below script are working in cs4 - cs5.5. i need to run the script in indesign cs2.
    can you please help.
    Main();
    function Main() {
        var foundItem;  
        var doc = app.activeDocument;
        //app.findTextPreferences = app.changeTextPreferences = NothingEnum.NOTHING;
    app.findTextPreferences.findWhat = "^p";
           //app.findTextPreferences.appliedParagraphStyle = "head";
        var foundItems = doc.findText();
        for (var i = 0; i < foundItems.length; i++) {
            foundItem = foundItems[i];
            foundItem.applyParagraphStyle(doc.paragraphStyles.item("content body indent"), false);
         app.findGrepPreferences = app.changeGrepPreferences = NothingEnum.NOTHING;
         var myDocument = app.activeDocument;
    //Clear the find/change text preferences.
    app.findTextPreferences = NothingEnum.nothing;
    app.changeTextPreferences = NothingEnum.nothing;
    //Set the find options.
    app.findChangeTextOptions.caseSensitive = false;
    app.findChangeTextOptions.includeFootnotes = false;
    app.findChangeTextOptions.includeHiddenLayers = false;
    app.findChangeTextOptions.includeLockedLayersForFind = false;
    app.findChangeTextOptions.includeLockedStoriesForFind = false;
    app.findChangeTextOptions.includeMasterPages = false;
    app.findChangeTextOptions.wholeWord = false;
    //Search the document for the string "copy" and change it to "text".
    app.findTextPreferences.findWhat = "^p";
    app.changeTextPreferences.changeTo = "^p";
    myDocument.changeText();
    //Clear the find/change text preferences after the search.
    app.findTextPreferences = NothingEnum.nothing;
    app.changeTextPreferences = NothingEnum.nothing;
    abc();
    function abc() {
        var foundItem;  
        var doc = app.activeDocument;
        //app.findTextPreferences = app.changeTextPreferences = NothingEnum.NOTHING;
    app.findTextPreferences.findWhat = "*";
           //app.findTextPreferences.appliedParagraphStyle = "head";
        var foundItems = doc.findText();
        for (var i = 0; i < foundItems.length; i++) {
            foundItem = foundItems[i];
            foundItem.applyParagraphStyle(doc.paragraphStyles.item("RealEstate"), false);
         app.findGrepPreferences = app.changeGrepPreferences = NothingEnum.NOTHING;
         var myDocument = app.activeDocument;
    //Clear the find/change text preferences.
    app.findTextPreferences = NothingEnum.nothing;
    app.changeTextPreferences = NothingEnum.nothing;
    //Set the find options.
    app.findChangeTextOptions.caseSensitive = false;
    app.findChangeTextOptions.includeFootnotes = false;
    app.findChangeTextOptions.includeHiddenLayers = false;
    app.findChangeTextOptions.includeLockedLayersForFind = false;
    app.findChangeTextOptions.includeLockedStoriesForFind = false;
    app.findChangeTextOptions.includeMasterPages = false;
    app.findChangeTextOptions.wholeWord = false;
    //Search the document for the string "copy" and change it to "text".
    app.findTextPreferences.findWhat = "*";
    app.changeTextPreferences.changeTo = "";
    myDocument.changeText();
    //Clear the find/change text preferences after the search.
    app.findTextPreferences = NothingEnum.nothing;
    app.changeTextPreferences = NothingEnum.nothing;
    ab();
    function ab () {
        var foundItem;  
        var doc = app.activeDocument;
        app.findTextPreferences = app.changeTextPreferences = NothingEnum.NOTHING;
        app.findTextPreferences.findWhat = " ^ ";
    app.changeTextPreferences.changeTo = " ";  
        //app.findTextPreferences.appliedParagraphStyle = "head";
        var foundItems = doc.findText();
        for (var i = 0; i < foundItems.length; i++) {
            foundItem = foundItems[i];
            foundItem.applyParagraphStyle(doc.paragraphStyles.item("day"), false);
        app.findGrepPreferences = app.changeGrepPreferences = NothingEnum.NOTHING;
         var myDocument = app.activeDocument;
    //Clear the find/change text preferences.
    app.findTextPreferences = NothingEnum.nothing;
    app.changeTextPreferences = NothingEnum.nothing;
    //Set the find options.
    app.findChangeTextOptions.caseSensitive = false;
    app.findChangeTextOptions.includeFootnotes = false;
    app.findChangeTextOptions.includeHiddenLayers = false;
    app.findChangeTextOptions.includeLockedLayersForFind = false;
    app.findChangeTextOptions.includeLockedStoriesForFind = false;
    app.findChangeTextOptions.includeMasterPages = false;
    app.findChangeTextOptions.wholeWord = false;
    //Search the document for the string "copy" and change it to "text".
    app.findTextPreferences.findWhat = "^";
    app.changeTextPreferences.changeTo = "";
    myDocument.changeText();
    //Clear the find/change text preferences after the search.
    app.findTextPreferences = NothingEnum.nothing;
    app.changeTextPreferences = NothingEnum.nothing;

    @s_ashok – you'll find the right methods and properties in the CHM file for InDesign CS2 at:
    http://www.jongware.com/idjshelp.html
    Just a few hints:
    InDesign CS2 does not support GREP search/replace, so every line in your code that points to GREP does not work.
    Further: "app.findTextPreferences" and "app.changeTextPreferences" were "app.findPreferences" and "app.changePreferences" in InDesign CS2. And then there were no "findChangeTextOptions" or any counterpart for that in CS2…
    That should get you running…
    I have no InDesign CS2 installed to debug, so this is all I can say…
    Uwe

  • How you guys do this ? finding the latest thread and applying recovery

    hi guys,
    i am doing a bash script and i need to do know the latest arch log sequence every archived.
    to know the latest arch log
    i) either get the max(seq#) from v$archived_log
    or
    ii) i can go to the arch folder and get the one with the latest date.
    however,
    how do i get that value out and apply it in rman ?
    Inside my rman script, i have got this..
    recover database until sequence xxxx;
    how do i fill in the value 'xxxx' ? with the latest archived log in the database ?
    please advise
    regards,
    Noob

    V$LOG_HISTORY to view the redo logs that you have archived.
    Perform an incomplete recovery until log sequence number 6 on thread 1:
    run {
    set until logseq 6 thread 1;
    allocate channel ch1 type 'sbt_tape';
    restore database;
    recover database;
    alter database open resetlogs;
    reset database;
    back up the database for new incarnation
    run {
    allocate channel ch1 type 'sbt_tape';
    backup database;
    }

  • I can't find my serial numbers and I never registered it on the website! I need to re-install on a new computer! What do I do?

    I bought a new computer and cant find my codes for my CS6. I got it through financial aid through school and I never registered the product on the adobe website. I need it installed on my new computer ASAP! Im failing school because of this issue!

    You're blaming others for your messy bookkeeping? That's gross! Contact edu support by mail or web chat and have your credentials handy, but otherwise there is nothing anyone can do.
    Mylenium

  • Unique regular expression to check if a string contains letters and numbers

    Hi all,
    How can I verify if a string contains numbers AND letters using a regular expression only?
    I can do that with using 3 different expressions ([0-9],[a-z],[A-Z]) but is there a unique regular expression to do that?
    Thanks all

    Darin.K wrote:
    Missed the requirements:
    single regex:
    ^([[:alpha:]]+[[:digit:]]+|[[:digit:]]+[[:alpha:]])[[:alnum:]]*$
    You either have 1 or more digits followed by 1 or more letters or 1 or more letters followed by 1 or more digits. Once that is out of the way, the rest of the string must be all alphanumerics.  The ^ and $ make sure the whole string is included in the match.
    (I have not tested this at all, just typed it up hopefully I got all the brackets in the right place).
    I think you just made my point.  TWICE.  While the lex class would be much more readable as a ring.... I know all my brackets are in the correct places and don't need to hope.
    Jeff

  • Find inline objects and apply object styles...

    Hi Eveyone,
    I am trying to find placed inline rules and apply object styles through javascript. Because we need some baseline shift to those rules. I getting some error while find the rules. FInd the syntax below,
    app.findObjectPreferences=app.changeObjectPreferences=null;
    app.findChangeObjectOptions.properties =
      objectType: ObjectTypes.unassignedFramesType
    app.findObjectPreferences.strokeWeight=1;
    app.changeObjectPreferences.appliedObjectStyles=app.activeDocument.objectStyles.item("WOL" );
    app.activeDocument.item(0).changeObject();
    Can anyone look into this help for me. Thanks in advance.
    Regards
    Thiyagu

    Hi Dave,
    I have tried the script after removing "s" in it. Now i am getting error like "object doesn't support the property or method 'appliedObjectStyle'". Please look into this and help me out. Herewith i attached the 'error' dialog snapshot.
    When i tried this in loop its working fine. Find the script below.
    app.findObjectPreferences=app.changeObjectPreferences=null;
    app.findChangeObjectOptions.properties =
      objectType: ObjectTypes.unassignedFramesType
    app.findObjectPreferences.strokeWeight=1;
    myFindObj=app.findObject(true);
    for(i=0;i<myFindObj.length;i++){
        myFindObj[i].appliedObjectStyle=app.activeDocument.objectStyles.item("WOL");
    alert ("DONE!");
    Regards
    Thiyagu

  • Problems moving text from safari to numbers and pages

    Hi,
    I'm trying to copy some data from a website, for example, an address with multiple lines of text, and paste it into a cell in numbers, and from there into a cell in a table in pages.
    The trouble is that the original text is sometimes formatted on the web site with returns after each line, and when I try to paste that into numbers or pages, each line goes into a different cell, which is a pain in the ***, and I have to retype the whole thing.
    Is there some way that I can have this do what I want it to do, that is, paste the entire address into a single cell?
    Thanks.

    We must double click in the cell before pasting if we want that several 'paragraphs remain in a single cell.
    I clicked once in cell B2, but I clicked twice in cell C2
    Yvan KOENIG (from FRANCE samedi 25 octobre 2008 21:18:35)

  • When I look up email addresses in Outlook 2010 on my pc, it only finds cell phones.  How do I get it to find email addresses automatically?

    When I look up email addresses in Outlook 2010 on my pc, it only finds cell phones.numbers.    How do I get it to find email addresses automatically?

      Addl question:  when I DO send an email from the address book, they are all coming back with the msg: 
    The following recipient(s) cannot be reached: & None of your e-mail accounts could send to this recipient.
    But when I type in the exact same address manually, it goes thru just fine.

Maybe you are looking for

  • K9n platinum memory

        I just purchased a k9n platinum  motherboard.Does anyone have any suggestions on memory for this board? I was considering corsair twin 2x1024-5400c4 or  kingston khx5400d2/1g.Also I am not sure if i should go with dual channel or single {does it

  • Java.lang.NullPointerException

    hi, Im trying to run a application Transfer.java which uses a middleware XML-DBMS to transfer XML data to the Oracle database.Transfer.java compiles without any errors but when i try to run it it gives the 'java.lang.NullPointerException'.I dont know

  • Need help displaying rank of records in report

    Post Author: tpoland CA Forum: General I have a report that is contains summary information that needs to be ranked at the summary level based on performance.*note, this data is completely fictional Company Location Dealer Volume Walkin Volume CarQue

  • ESS W2 Reprint service

    Hello , I am on EP7.0 ERP05 and NW04s and deployed ESS Standard Business Pack and what I found in the BP that the iview for W2 reprint service was missing ,so I created a view (type-webdynpro application) and pointed to the essussap.com->W2Reprint Ap

  • MacBook shuts down when streaming video

    I use safari, so my assumption is the problem lies there. I did a software update in January along with upgrading to snow leopard but this problem has been happening since before then. Its only a few years old and the only thig that's wrong with it i