Use GREP to find \r or \n
Hi all,
Consider a paragraph with multi lines, in between there is two lines seems empty. Now i have to break the paragraph based on the empty lines or carriage returns using GREP. Thanks for any help.
Regards,
Sasi
Hi all,
Consider a paragraph with multi lines, in between there is two lines seems empty. Now i have to break the paragraph based on the empty lines or carriage returns using GREP. Thanks for any help.
Regards,
Sasi
Hi Sasi,
Try the following, it will alert all the values that match, which you can then write to a text file or use as needed. Change the prompt word to anything else if needed, mind that the [ and ] would need to be escaped as done below. The a.contents is the text content of one block of match
app.findGrepPreferences.findWhat = "\\[Small\\]\\r(.*[\\r\\n])+?(?=\\r\\r)";
var match = app.activeDocument.findGrep();
// Clear the find/change preferences after the search
app.findGrepPreferences = NothingEnum.NOTHING;
while(a = match.pop())
alert(a.contents)
-Manan
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.