Remove the extra space of a long document

Hello

I've seen a number of find/replace and GREP formulas to do similar things. I have NO scripting language or coding experience and have worked to understand GREP.

So I'm a little afraid to use it because I don't know what all the modifiers call (I have a few neat GREP cheatsheets print as Mike Witherell I can absorb up to get a good reference)

I need something I can copy and paste into find/replace or dialog GREP that will do the following in less than 12 steps (we hope) without doing something as catastrophic as the removal of all my paragraph marks (which I almost did with someones GREP expression)

  1. No space before a comma, period, exclamation point, question mark, colon, semicolon
  2. A space only after any of these
  3. A space before an opening parenthesis and a space after the closing parenthesis
  4. No space before the closing parenthesis or after the opening parenthesis
  5. Remove double or extra spaces (en, em, etc.)
  6. Remove comma before parentheses
  7. Remove all white space after a paragraph mark

I think that's it

I found this one recently (perhaps Jongware?)

[~ m ~ > ~ f ~ | ~ S ~ s < ~/~,~3~4%] {2.

From my limited understanding addresses em, in, flush and hair, space nonbreaking, space figure, third space - not sure of the rest. It's really way over my head.

I know it will be a piece of cake for you guys

Thank you

I was hoping Jongware would come in with something really elegant (and maybe he'll still) but in the meantime, my approach would be to start by eliminating all multiple spaces except paragraph returns and forced line breaks. This appears to do:

Find (\s)(\p{space_separator}|\t) + and replace it with $1

This leaves the first space and will remove the following spaces to a line or a paragraph break (and not completely tested, but I guess that other kinds of breaks) is encountered, leaving the jump line or paragraph intact.  Note that this will destroy the tables built with tabs (as opposed to the 'real' tables) with several tabs between the items, and it does not alter a single space before a line or paragraph break.

Then I would remove the whitesapce at the ends of paragraphs, etc.:

Find (\s)(\n|\r) and repace with $2 seems to do, and it also seems to leave several returns (I don't know if you want to delete these) and work with the other breaks as well (again, not fully tested). The \s$ and replace it with nothing more simple, removes the first return to a sequence of two-back and seems to ignore e other types of breaks completely.

At this stage avoid any several spaces other than possibly empty paragraphs. If you want to get rid of these, you can run find/replace list script by the integrated switchis refers to the single request of return in the dropdown, find/replace.

So now you find the opening of single and double parentheses, square brackets or braces quotes and remove space after them, if it exists:

Find ([\[\{\(~{~[])(\s) and replace it with $1

and finally to remove any white space before your selected punctuation and the closure of the above case:

Find (\s)([.,;:!\)\]\}~}~]]) and replace it with $2

The last two queries will probably also work with look-bhind for the first and to come to the second (putting classes in the expressions of the eyes) and repalcing with nothing, but I don't know which method is the most effective. The last request might also be missing a space and an apostrophe or mistakenly remove a space before a work that begins with an apostophe (again, not tested). and is ignoring straigh citations of any type, because they are ambdextrous and may want to space on each side.

I hope that the forum does not spoil one of these phrases...

Tags: InDesign

Similar Questions

  • How to remove the extra space of oracle database column

    How to remove the extra space of oracle database column. I would like to clean up the column in the database by deleting the extra space is entered by the dataentery people.

    When I run the query:
    SELECT
    ROWID, C.CODETABLE_ID, C.CODEVALUE_ID, C.DESCR, LENGTH (C.CODEVALUE_ID).
    C.OBSOLETE_DT, C.RECORDSOURCE, C.CREATED_DT,
    C.CREATEDBY, C.LASTUPDATED_DT, C.LASTUPDATEDBY
    OF CODEVALUE C
    Where LENGTH (C.CODEVALUE_ID) > 6

    the data type is varchar2 and I would get rid of the any extra blank space added to the column. in my case, if the length is greater than 6

    Hello

    user452051 wrote:
    Thanks for the reply. Why should I have this line?

    AND codevlaue_id! = TRIM (codevalue_id) - see note below
    ;

    I just changed my post when you posted this. The explanation is there now:

    Frank Kulash wrote:
    ...
    The condition "codevlaue_id!" = TRIM (codevalue_id)"does not change the results of everything, but it can make the most effective statement if there are lines where codevalue_id is on 6 characters long, but contains no additional space. It will prevent the triggers from firing and redo the data generated.

  • How to remove the extra space between two Table HTML

    Hello

    I wrote a code for printing costs. But there is more space between two Table Html, how I can remove it.

    Please run that Code

    Start

    HTP.p (')
    < html >
    (< body > ');

    HTP.p (')
    < TABLE align = "left" width = "500" cellspacing = "0" cellpadding = "0" border = "1" >
    < tr > < td align = 'right' white-space: nowrap; > Ph-2201751 < table >
    < td > < table >
    < /tr >
    < tr > < td align = "center" white-space: nowrap; > < B > < table > < /B > SATYAM MODERN PUBLIC SCHOOL
    < td > < table >
    < /tr >
    < b >
    < td align = "center" white-space: nowrap; > < i > < H3 > (AFFILIATED to THE CBSC, NEW DELHI CODE No. 53544) < / H3 > < /I > < table >
    < td > < table >
    < /tr >
    < tr > < td align = "center" white-space: nowrap; > new colony Braham, - 131001 (h) < table >
    < td > < table >
    < /tr >
    < tr > < td align = "center" white-space: nowrap; > RECEPTION COSTS < table >
    < td > < table >
    < /tr >
    < /table >
    < TABLE width = "500" cellspacing = "0" cellpadding = "0" border = "1" >
    < b >
    < td width = "100" white-space: nowrap; > receipt no.: < table >
    < td width = "100" white-space: nowrap; > Date received: < table >
    < /tr >
    < b >
    < td width = "100" white-space: nowrap; > name: < table >
    < td width = "100" white-space: nowrap; > father name: < table >
    < /tr >
    < b >
    < td width = "100" white-space: nowrap; > class & s: < table >
    < td width = "100" white-space: nowrap; > A/C No. : < table >
    < /tr >
    < b >
    < td width = "100" white-space: nowrap; > from: < table >
    < td width = "100" white-space: nowrap; > to: < table >
    < /tr >

    (< /table > ');
    HTP.p (')
    < / body >
    (< / html > ');
    end;


    Thank you

    Ed

    Hello

    HTML is valid, that your code print?

    
    

    Wouldn't be as below?

    
    

    BR, Jari

    Published by: jarola on December 18, 2009 15:22
    I test your code
    http://Apex.Oracle.com/pls/OTN/f?p=40323:25
    I can't see any extra space between the tables

  • Remove the extra white column of table of FY

    How to remove the extra space of af: table at the end?

    thnks

    to control the width of the table:
    Set the style class: AFStretchWidth
    and the value of columnStretching to last (or choose any column)

    to control the height
    Set the style inline to height: 154px; (change the number you need)

  • Get the extra space in the table

    I use af:table for whom

    1. I use the styleclass AFStretchWidth and I put the width to 100%

    2. I'm defining the width of the columns in % (sum of the width of all columns is 100%)

    3. about the table with af:panelCollection and using AFStretchWidth styleclass.

    4. about the table and af: panelCollection with af:panelGrouplayout, the line is vertical and the styleClass is AFStretchWidth.

    And I use the same table 4 cases but I get the extra space that in rare cases. Am I missing something?

    Set columnStretching = "last" or one of the columns will disable the percentage of column widths, this means that if you set the columnStretching = "last" column width table and set = "15%" when running, the column width will be '15px '. If you want to set the column width by the percentage of the columnStretching of the table must on "multiple" as you did.

    So, if you want to set columnStretching = 'last' table, you must set the column width of pixels (width = "120").

    Your page looks ok, you set columnStretching = "multiple" and you set the columns width in percentage but try to remove the width of the table = '100% ' and test again.

  • Remove the column space

    Hi, just wanted to help regarding the deletion of my user name column spaces. I used the following code to remove the double space to a single space.
    regexp_replace(table_a.username, ' {2,}', ' ')
    but when you look through my answers I noticed that there is an extra in a few names at the end of the field as well. The original double space was between first name and family name, but now I have to replace the space completely, but don't know how.

    If someone could please advise.

    Thanks in advance.
    with t as (
               select 'ABC         DEF   ' str from dual
              )
    select  regexp_replace(str,' *( |$)','\1')
      from  t
    /
    
    REGEXP_
    -------
    ABC DEF
    
    SQL> 
    

    SY.
    P.S. It does not remove the spaces to the left, just backwards.

    SY.

  • remove the odd spaces of the hexadecimal string

    Hello

    I would like to remove the odd spaces to a hexadecimal string, and the output result.  That's what the input string will look like:

    01 00 04 0F FF 36 3B CC...

    I want the output to be:

    0100 040F FF36 3BCC...

    I got the attached forum labview code earlier, but it does not work with the text.

    Any help is greately appreciated.

    Thank you

    hiNi.

    Try this version 8.2.

  • I don't have access to the standard account is a password on the administrative account and don't remember and I don't want to remove the account because I have important documents, how can I access the account without the password

    I don't have access to the standard account is a password on the administrative account and don't remember and I don't want to remove the account because I have important documents, how can I access the account without the password

    http://support.Microsoft.com/default.aspx/KB/189126

    "Microsoft's strategy concerning lost or forgotten passwords"

    Microsoft cannot help you recover the passwords of the files and Microsoft who are lost or forgotten product features. Mick Murphy - Microsoft partner

  • Every time when my comp. goes to sleep, wake up I have to sign in. How can I remove the extra sign in?

    Every time when my comp. goes to sleep, wake up I have to sign in.  How can I remove the extra sign in?

    David,

    See my reply in the thread How to unlock a user on my computer?

  • Remove the empty spaces and LF between lines in xml

    Is there a way to remove the empty spaces and LF between XML nodes?

    Let's say I

    CLOB l_clob;

    ..

    l_clob: ='

    < root >

    < name > ioerio < / name >

    < 10 > < / age >

    < / root >

    ';

    I need to get a XML in a single line without spaces and withoud LF...

    Example:

    SQL > ed
    A written file afiedt.buf

    1 declare
    2 l_clob clob.
    3. start
    4 l_clob: ='
    5
    6 ioerio
    7    10
    8

    9  ';
    10 l_clob:=replace(l_clob,chr(10)); -Remove line breaks
    11 l_clob: = regexp_replace (l_clob, ' > +)<','><>
    12 dbms_output.put_line (l_clob);
    13 * end;
    SQL > /.
    ioerio 10

    Must say, this is a strange requirement.  Most people ask how to do the reverse.

  • Windows 8 is not recognizing the extra space in the hard disk resized

    I was out of the room on the virtual drive of Windows 8 in VMWare Fusion 5.02. I increased the size of the disk in the settings, but when I run Windows, he does not see the extra space. Obviously, I have to leave something out of the process. If you can help me, please let me know what I am doing wrong. Thank you!

    Have you ever increase the NTFS of Windows partition in disk management or you do not see the additional disk space

    André

  • How to remove the white space between two response reports

    How to remove the white space between two response reports

    In the section of dashboard, I have 2 rqeuest. Each query returns Table view. When I view the dashboard, it shows a blank separating 2 table views. How can I get rid of the band of white/white space?

    See this link

    Re: Remove the space between the two reports on the dashboard page OBIEE Section

    Kind regards
    Sandeep

  • Statement of update to remove the 'white spaces '.

    Database: Oracle 11.2.0.1.0

    In the database, we have values in the columns that contain the 'white spaces' a few times before and/or after the value.  What is the best procedure to remove these extra white space?  I have given some examples below.

    Account number InvoiceNumber
    123INV-123
    456INV-456
    789

    INV-456

    123 456INV 123456

    1st row, 5 white space before the value of a.

    Line 2 has 5 white spaces after the value

    Rank 3, has 5 spaces before and after the value

    Tier 4, has 5 white spaces between the value < = it's alright

    Essentially, I don't want to cut the sides LEFT and RIGHT only.  Every thing in the meantime doesn't seem to be a problem at this time.  Is the query below the best procedure to manage withdrawal?

    Update table1

    the AccountNumber value = trim (AccountNumber);

    Hello

    976563 wrote:

    Database: Oracle 11.2.0.1.0

    In the database, we have values in the columns that contain the 'white spaces' a few times before and/or after the value.  What is the best procedure to remove these extra white space?  I have given some examples below.

    Account number InvoiceNumber
    123 INV-123
    456 INV-456
    789

    INV-456

    123 456 INV 123456

    1st row, 5 white space before the value of a.

    Line 2 has 5 white spaces after the value

    Rank 3, has 5 spaces before and after the value

    Tier 4, has 5 white spaces between the value<==== this="" one="" is="">

    Essentially, I don't want to cut the sides LEFT and RIGHT only.  Every thing in the meantime doesn't seem to be a problem at this time.  Is the query below the best procedure to manage withdrawal?

    Update table1

    the AccountNumber value = trim (AccountNumber);

    The SET clause is the best way, but you can add a WHERE clause.  Without a WHERE clause, you will update every row of the table, including rows that are already perfect, who will be ineffective.

    Try this:

    UPDATE table1

    SET AcountNumber = TRIM (account number)

    WHERE AccountNumber <> TRIM (account number);

    If AccountNUmebr is NULL, the conditon of WHERE clause evaluate to UNKNOWN, and if the line will be not updated unnecessarily.

  • To remove the empty spaces without filling of browser?

    Hi all

    I'm trying to get rid of the empty space on the left and right, also some items appear suddenly in preview mode. Here are two screenshots that show you exactly what's wrong. Is it possible to get rid of the empty spaces, or is the only thing that removes whitespace a background fill? Also how can I make sure the items the same size as in the design mode, since in the preview suddenly the gray rectangle is longer than composition.

    -Roy

    screenshot_volcano1.pngscreenshot_volcano2.png

    You must use a browser fill. The monitor must have some sort of element to show or it would only show through and you would see the interiors of your monitors technology.

    If you have a site that is 960px wide and a monitor that is 1200 for example there must be something out there. That is why the filling of the browser. To choose a fill color or image file of the browser background that matches your site.

  • How to remove the empty space between the lines of the content of a PDF file?

    Attempt to modify a document by removing lines of unnecessary operations and while that in the edition of content/tools I can easily remove the content.  The problem is who is left a vacuum and the white space and does not move the content below the space upwards to maintain the format.  I'm trying to find a way to eliminate the gaps of whitespace on a page where the content used to be. See below...

    There is no easy way to do it, as PDF files should never be edited in a way. You will need to select the items below and drag them to the top.

    Of course, the best approach is to change the format of the original file and then generate a new PDF file, if possible.

Maybe you are looking for