Delete the first 4 characters in a cell... (IND CS4)

I need to delete the first 4 characters if the text of the cells begins by "< Cs.


Is it possible without using "find/replace"?

My script is something like that... 


var doc=app.documents[0]; 
var allTablesArray=doc.stories.everyItem().tables.everyItem().getElements();


/************************************************************************/
var TbCount = allTablesArray.length;
for(var Tb=0; Tb<TbCount; Tb++) {
  var Tab = allTablesArray[Tb];
  var numRows = Tab.rows.length - 1;
  for(var R=numRows; R>=0; R--) {
  var numCells = Tab.rows[R].cells.length - 1;
  for(var Td=numCells; Td>=0; Td--) {
  var xCell = Tab.rows[R].cells[Td];
  var Content_3 = xCell.contents.slice(0,3);
  if (Content_3 == "<Cs") {
  //Remove the first 4 characters in the cell
  }
  if (Content_3 == "<Rs") {
  //Remove the first 4 characters in the cell
  }
  }
  }
}
//*****************

Hello

Try this...

var doc=app.documents[0];
var allTablesArray=doc.stories.everyItem().tables.everyItem().getElements();  

/************************************************************************/
var TbCount = allTablesArray.length;
for(var Tb=0; Tb=0; R--) {
    var numCells = Tab.rows[R].cells.length - 1;
        for(var Td=numCells; Td>=0; Td--) {
        var xCell = Tab.rows[R].cells[Td];
        var Content_3 = xCell.contents.slice(0,3);
            if (Content_3 == " 
         

Tags: InDesign

Similar Questions

  • How to remove the first few characters of a string of liquid

    I would like to delete the first three characters of a string of liquid. The question is how.

    If I use the markup according to liquid when I know what are the first characters

    {{it. {{["Estate status'] | strip_html | remove_first:"11."}}

    It will remove the 11 characters.

    But if I don't know what are the first characters, this markup can I use to get "RID" of the first three characters?

    I tried 'split' and 'slice', but it must always know what characters to split or slice.

    Thanks for any help.

    Kind regards

    Carla

    Assign a value into slices and you can have table data that you can get out.

  • SQL query to get the first four characters of an address

    Hi gurus,


    Can you please help me with the below quries on how to achieve this. Could be really helpful if you could provide a sample sql on your side.


    Req:

    I have a requriement where I should display the first four characters other than a space to address, for example: becomes R, DISH etc. F. in passing in a ROOM address a DISH 1 FLORIAN AVENUE would therefore "RAF1", while a CORNER, 23 STREET address would be "23CO".


    Words such as c/o, co, rear should be ignored, if any.

    Thanks in advance.


    Kind regards

    Peoples

    Hi John,.

    Here is an implementation of a pl/sql function that suggested a franc. It uses two lists, one with the words which are replaced with the first character and a second with words to ignore.

    create or replace function first_four (p_input in varchar2) return varchar2 is

    type t_words is table of the varchar2 (100);

    p_replace t_words: = t_words ('ROOM', 'FIELD', 'FLAT', 'FLT', 'BLOCK', 'UNIT', 'STUDIOS', 'CARAVAN', 'APARTMENT');

    p_ignore t_words: = t_words ("C/o ', 'CO', 'BACK TO'");

    v_input varchar2 (100);

    Start

    -Put the entry in a local-variable he

    v_input: = upper (p_input);

    -delete the words contained in the ignore list

    because me in 1.p_ignore.count

    loop

    v_input: = replace (v_input, p_ignore (i));

    end loop;

    -Replace the words by first character in the replacement list

    for r in 1.p_replace.count

    loop

    v_input: = replace (v_input, p_replace (r), substr (p_replace (r), 1, 1));

    end loop;

    -remove the spaces and return only the first 4 characters

    Return substr (replace (v_input, ' '), 1, 4);

    end;

    /

    It returns the expected results for the four examples you gave:

    SQL > with t as)

    2 select address 'FLAT 3 a 12 LILLYHAM ROAD' of all the double union

    3 select ' GREE LANE GLOSONTH 45' across Union double

    4 Select "FLAT 3 221 b Baker Street," of all the double union

    5. Select "C/o CARAVAN 32 STREET BLOK 6 RICHMOOND' of the double)

    6. Select ff first_four (address) of t;

    FF

    --------------------------------------------------------------------------------

    F3A1

    45GR

    F322

    C32B

  • v$ fixed_view_definition where and ' GV$ SESSION "= only the first 4000 characters

    Hi all

    I need to get the defeintion of the opinion GV$ SESSION.

    I get only the first 4000 characters.

    Select * from v$ fixed_view_definition where view_name = "GV$ SESSION;

    Could you please help me?

    Thank you

    Cherif.

    Cherif bh wrote:

    Hi Martin,

    Thanks for your help. I use 11.2.0.3 and is EXPAND_SQL_TEXT added 12 c.

    I try to get the definition of a problem of performance on gv$ session; I need a list of the tables and columns and add the best predicates and access them using indices

    You should be able to get the same thing on 11.2.0.3 too:

    https://jonathanlewis.WordPress.com/2012/07/10/expanding-SQL/

    The package is called DBMS_SQL2 it.

    Randolf

  • I have a text field. I need to remove the first 8 characters of the field, leaving the remaining characters. Help?

    I have a text field. I need to remove the first 8 characters of the field, leaving the remaining characters. Help?

    Example:

    Text Example.JPG

    I need to remove these numbers PXXXXXX. Leaving the other characters.

    Thank you

    Bob

    A normal 'substring' is what you're looking for.

    For a formula of the column in the response criteria tab:

    SUBSTRING ("YourPresTable". "YourPresColumn" OF 9)

    To make the RPD and the workload of shipping off the coast to the database rather than forcing the work on the server of the OBI or presentation:

    Substring ("01 - Sample App Data (ORCL)" ".." ") "" "BISAMPLE '." " D10 product (dynamic table)". ("' Prod_Dsc ' 9)

  • How can I remove the first 3 characters of the files?

    I'm using the bridge for a while and rename the lot

    How can I rename to remove the first 3 characters of the files?

    (these are numbers)

  • GREP string to select the first 2 characters of an e-mail address

    I want o apply the formatting for the first two characters of an e-mail address:

    [email protected]

    the party @domain.com never changes so I can simply place in parentesis.

    So far I managed to isolate the word in front of the e-mail domain:

    \w+([email protected])

    I want to select only the first two characters of the word before the @domain.com

    any ideas?

    Thank you!

    No, sorry. Try this:

    \b[-\w]{2}(?=[-\w]+@domain\.com)

  • Script to remove the first few characters of a PDF file name?

    I know it should be easy, but I'm not a coder and don't have many opportunities to write scripts.  I hope it's like a second request two anyone out there.  All I want to do is point a script in a PDF file that will review the file name, cut the first two characters of the file name and save the original file again.  I need to do this about 400 PDF documents on a recurring basis, hence the need for a script.  Thus, for example, if I have a C:/temp/myFile.pdf file, I would the script to rename the file to just "file.pdf".

    Any help would be greatly appreciated.

    JBF

    Use this code in your action (note that this will not work if your file name)

    contains the comma):

    var filePath = this.path.replace(this.documentFileName,"");

    var NouveauNomFichier = this.documentFileName.substring (2);

    this.saveAs (filePath + newFileName);

  • The first 250 characters of the HTML output

    Is anyone know how the first 250 characters of html output file.
    I use a cfinclude to the output file, but sometimes the HTML is really long and there are other things on the page. I would like to limit the HTML for a number of characters and to give the user an option to read the rest.
    An example but this is not a job would be < cfinclude template = "#left(file.htm, 250) #" >. I know that this does not work, but he would if the information was in a database.

    Any suggestions?
    Thank you




    #left(mytext, 250) #.

    You may also want to strip all html out of var mytext tags in the order
    do not have CF cut in the middle of a tag and make it to the exit:

    #left (trim (rereplace (mytext, "<[^>] * >", "", "all")), 250).

    Azadi Saryev
    SABAI - Dee.com
    http://www.SABAI-Dee.com/

  • How can I trap FRM-40102: Record must be entered or deleted the first error

    Whenever I click the box tool button insert record (green more) I get FRM-40102: Record must be entered or deleted the first error. How to catch the trap this error?

    IF errnum = 40102 THEN
    Clear_All;
    create_record;
    END IF;

    I want to put the above code. What trigger, I need to add this code. I have the multi block shape.

    Hi Chris,
    You can use the ON-ERROR trigger at the level of the form like that...

    IF ERROR_CODE=40102 THEN
     -- Do something here...
    ELSE
      MESSAGE(ERROR_TEXT);
      MESSAGE(ERROR_TEXT);
      RAISE FORM_TRIGGER_FAILURE;
    END IF;
    

    -Clément

  • Only the first 70 characters of an output string

    Hey this is probably an easy question for anyone to answer. I googled and could not find anything. I'm a value in a table, it's more than 70 characters long, but when I use DBMS_OUTPUT. Put_line I want only the first 70 characters of output. How can I do this?

    Thank you!

    SUBSTR

  • How to remove the first 11 characters of a string

    With the help of ' XML Publusher Desktop / generator model for Word / 5.6 Build 45'

    I use XML Publisher. With the help of a RTF model, to generate purchase orders by email of the purchase of the Oracle.

    The fields are drawn from the XML code generated by Oracle.

    One of the fields is the place of delivery Description field.

    Will appear in the report as follows:

    * & lt;? SHIP_TO_LOCATION_NAME? & gt; *

    When I attach a test XML file in Word and view the output, one of my test case returns a description of the site:

    DON'T code USE County Hall of Global location

    What I have to do is to remove the * DO NOT USE * according to the description of the location.

    I could do is a Find / Replace, or a substring to ignore the first 11 characters from the string. But I don't know how to do it.

    Any help would be much appreciated, because it is a production problem that is causing a bit of a small problem for us!

    Thank you very much.

    Hello
    Maybe you know this syntax :)

    Rahul

  • Why Flash cookies are not deleted the first time I'm leaving Firefox?

    I am running XP, Firefox 16.0.1 and Flash Player 11.4.402.287 and have Firefox configured to 'Clear history of Firefox closing', with 'Cookies' (among others) checked "settings to erase history. I also have Flash Player configured to "Block all sites to store information on this computer."

    As I understand it, from Firefox 4 and Flash Player 10.3, have Firefox configured in this way should cause cookies Flash should be deleted out of Firefox. I also understand that even though I have Flash configured as I do, a list of websites that try to plant a cookie Flash is always recorded in the main settings.sol cookie.

    I noticed, however, that this list of empty Flash cookies is not removed the first time I have quit Firefox; on the contrary, the list is deleted after launch and then leaving Firefox again.

    Here is a step-by-step example:

    (1) Control Panel-> Flash Player-> storage tab-> storage Local to Site-> button settings confirm that the list is empty

    (2) output, that manage Flash Player settings

    (3) launch Firefox-> go to http://www.Hulu.com/ and click on a video to start playing

    (4) recovery Control Panel-> Flash Player-> storage-> Local website storage settings... tab button-> make sure that the list indicates http://www.Hulu.com/, 0 bytes, block

    (5) leave the Flash Player Settings Manager

    (6) Firefox exit

    (7) raise Control Panel-> Flash Player-> storage-> storage settings Local to Site-> NOTE THAT THE LIST SHOWS AGAIN http://www.Hulu.com/, 0 bytes, block

    (8) leave the Flash Player Settings Manager

    (9) restart Firefox

    (10) raise Control Panel-> Flash Player-> storage-> storage settings Local to Site-> NOTE THAT THE LIST SHOWS AGAIN http://www.Hulu.com/, 0 bytes, block

    (11) exit the Flash Player Settings Manager

    (12) exit Firefox

    (13) stimulus Control Panel-> Flash Player-> storage-> storage settings Local to Site-> NOTE THAT THE LIST IS now EMPTY

    Once again, my question is - why this list is not emptied the first time around?

    Safe mode disables plugins, I think not, so that you can put those aside for now.

    I suggest disable all non-essential extensions. We all tend to accrue to those who are not really necessary. You can do so here:

    Orange Firefox button or classic menu Tools > Modules > category: Extensions

    If the kernel extensions, you really like the cause of the same problem, then I think you will have to just live with it. Please note that Flash is followed correctly your bet as a block, so I don't think that something is actually stored.

  • delete the first line of operation alwaysdeletes

    Hi all

    I'm new to jdeveloper and I have some problems with the delete operation. I have a standard jsp page with data child parent. The child table has emplid and seqno in the form of key fields. When you try to delete the third (or any other line) row in the child table it somehow always deletes the line first. I tried using standard deletion operation and also have tried to use the code to remove the data below. Can someone please help me understand what could be the problem?
    I use jdeveloper 11.1.2.2

    Thanks in advance.

    {} public void deleterow (ActionEvent actionEvent)
    DCBindingContainer links =
    (DCBindingContainer) BindingContext.getCurrent () .getCurrentBindingsEntry ();
    DCIteratorBinding dcItteratorBindings = bindings.findIteratorBinding("EMPL_PROVW1Iterator");
    System.out.println ("HI" + dcItteratorBindings.GetCurrentRow ());
    dcItteratorBindings.removeCurrentRow ();

    This is the reason why...
    can u paste your table code so that I can help you...
    chk this
    http://docs.Oracle.com/CD/E21043_01/Web.1111/b31974/web_tables_forms.htm#CJAGIGAB

    
    
  • Flex 4 - display of the first n characters in a text block

    I have a set of data one of whose fields is a description of the product can be up to 800-900 characters long. I need to display than the first, say 200 characters. Example:

    The full field is

    (Stimulant free) natural appetite control 90 capsules item catalog number: 00891 a study published in the Journal of the American Medical Association reveals that overweight adults who have completed a program of modest reductions of body fat mass calorie restriction

    I want to display

    (Stimulant free) natural appetite control 90 capsules item catalog number: 00891 a study published in the Journal of the American Medical Association has found that overweight adults ...

    I use a < s:TextArea >.

    Any ideas on how to proceed would be greatly appreciated.

    Carlos

    Hello

    The strings have a substring function, it also works with the text property of such components which channels.

    var s1:String = "hello world";

    var s2:String = s1.substr (0.7);

    or with linebreaks
    mytextArea1.text mytextArea2.text.substr = (0.100);
    David.

Maybe you are looking for