Copy link to clipboard
Copied
I am looking to take MANY pages of client provided text in Word (first image) and easily get the second image (Bold First Paragraph)?
I know I can accomplish this if I edit the formatting - so each line isnt a paragraph (ie hard return or end of nested style) but wondering is there is a even easier way I may be missing?
If your header always has two hard returns before it (and no other paragraphs do), you could do a GREP search that looks for a single capital letter + period + two one or more spaces + any string of characters, preceded by two hard returns (using the "positive lookbehind" GREP).
Find what:
(?<=\r\r)(\u\.)(\s+)(.+)
Change to:
$1 $3
[Insert whatever number of spaces you want between $1 (the letter and period) and $3 (the rest of the text).]
Change Format: [Select the paragraph style where you've def
...Copy link to clipboard
Copied
Well, if the "Description" paragraph always starts with a single letter, followed by a period, followed by two spaces, followed by the word "Description", then in your shoes I'd use a GREP Find/Change query:
Find:
\u\.\s\sDescription
Change to:
$0
If there are other possible permutations of that paragraph (maybe once you get to Z it starts again with AA? Maybe Greek letters? Some of 'em don't have two spaces after the period?) then I'm sure we can adjust the Find query to find it.
Copy link to clipboard
Copied
Work with 2 Paragraph Styles
Use next style to get frm the headlines to the other lines.
Don't use 2 paragraphs to get space between lines. In your headline use space before instead.
To keep text together make paragraph styles keep with previous, only the headlines make keep with next instead.
My recommendation is, select all incomming text and apply the paragraph style. In the second step find 2 returns, replace with 1 return and the headline paragraph style. Use the find & replace command. You can save that as a preset to apply it faster.
Copy link to clipboard
Copied
Thank you. Will try this in my test file and see how it goes.
Copy link to clipboard
Copied
Always A-Z with a period .
Spaces unfortunately are anywhere form 1-3 (this is something I need to check on)
Description is actually a Product Description and always different.
Pilcrows are consistant.
Copy link to clipboard
Copied
If your header always has two hard returns before it (and no other paragraphs do), you could do a GREP search that looks for a single capital letter + period + two one or more spaces + any string of characters, preceded by two hard returns (using the "positive lookbehind" GREP).
Find what:
(?<=\r\r)(\u\.)(\s+)(.+)
Change to:
$1 $3
[Insert whatever number of spaces you want between $1 (the letter and period) and $3 (the rest of the text).]
Change Format: [Select the paragraph style where you've defined the bold font.]
However, the best practice would be to adjust the "space before" attribute in the paragraph style, rather than using double hard returns. To remove the double hard returns in the same search, edit the search to the following:
Find what:
(?<=\r)\r(\u\.)(\s+)(.+)
Change to:
$1 $3
[Insert whatever number of spaces you want between $1 (the letter and period) and $3 (the rest of the text).]
Change Format: [Select the paragraph style where you've defined the bold font and the space before.]
Copy link to clipboard
Copied
I agree with the space before. The Word document is pages of text just like the example - except "Description" is actually a description. With notations for the Page, nothing else.
Plan was to make the notations page breaks, and place the word document into my threaded frames, and fix the bold somehow, and the bulk of the work would be done.
Principle behind your example seems like it could work but when I tried, it didnt find a match.
Copy link to clipboard
Copied
Also just realized the spaces after the A. is not always 2. Need to check with client to see if it is intentional or error.
Copy link to clipboard
Copied
Apologies, I had a typo in one of my GREP search strings — I just fixed that in my original answer above, so it should work now., but let me know if you're still having issues. (And just to confirm — you're using the GREP search tab, not the Text search tab, right?)
I also updated it to look for one or more spaces after the period (rather than two spaces). In your Change to field, you can insert whatever number of spaces you want to be between the period and the description.
Copy link to clipboard
Copied
OMG it worked! Whoop! Thank you!
I'm assuming I would run a second Find/Replace to strip the Double Hard Returns seeing I will add in a space before or can it be done in the same run?
If you know of any learning resources for this feel free to share, I need to learn more.
Copy link to clipboard
Copied
In my original answer, I listed two different find/replace suggestions — the second one should strip out the double hard returns in the same run, but let me know if that's not working. Or if you want to do it separately, you could just find \r\r (two hard returns) and replace with \r (a single hard return).
There are plenty of resources on GREP that you can find online, but the ultimate guide is Peter Kahrel's book, GREP in InDesign. For a shorter intro, check out his article in InDesign Magazine.
Erica Gamet's GREP cheat sheet is such a handy reference guide, and she also has a whole GREP course.
Copy link to clipboard
Copied
Oops...I glazed over the minor difference in the two you posted. Sry
I have those resources bookmarked for reading. Thank you again for your help.