-
1. Re: If text exists after merge insert preceding word? Conditional Grep?
P Spier May 18, 2013 4:44 AM (in response to Angus Hume)The answer is probably yes, but we'd need more details about the following text.
On the other hand, it probably would be much simpler to include the text as another field in the data file.
-
2. Re: If text exists after merge insert preceding word? Conditional Grep?
Angus Hume May 19, 2013 7:01 PM (in response to P Spier)The following text is technical, and varies, such as
AWS/ASME-SFA A5.18 ER70S-6
AS/NZS 14341-B G 49A 3U C S6, G 49A 3U M S6
I could only see it working if it was possible to test in a very general sense if there was text there or not.
I know I could add label fields in Excel, but it's a pretty complex spresdsheet already and I was hoping to avoid adding more columns to it if possible. It's frustrating that this sort of conditional stuff is easy in something like Word but InDesign's merge functionality is practically unchanged from the it's origins in Pagemaker.
-
3. Re: If text exists after merge insert preceding word? Conditional Grep?
P Spier May 20, 2013 6:05 AM (in response to Angus Hume)ID does have Conditional Text, which may also be another option. Conditonal text is shown or hidden globally, and the same text can, I believe, carry more than one condition.
But that still leaves trying to test to apply the conditions, or doing it manually (by some sort of code in the data) before the merge. If you know all of the possible combinations of following text I'm sure this can be scripted, but the effort involved is probably more than adding the columns to the spreadsheet.
-
4. Re: If text exists after merge insert preceding word? Conditional Grep?
Angus Hume May 20, 2013 7:32 PM (in response to P Spier)Thanks for the suggestions Peter, I had looked into conditional text but as I understand it is more akin to layers. You create a condition yourself, apply it to a text selection and then make that condition visible or not literally like a layer within a text block. Good for language variations etc in one document but I don't think it can be used for this.
If I put a code in the data source then I may as well just add the labels.
And as the data varies quite a lot I was after a general test for non empty state rather than scripting in tests for every specific text variation. Looks like I'll just have to add more columns to my spreadsheet. Groan, 800+ line items.
-
5. Re: If text exists after merge insert preceding word? Conditional Grep?
P Spier May 21, 2013 4:39 AM (in response to Angus Hume)So maybe I'm not really understanding the problem.
You can use a look-ahead in GREP, perhaps, but I'm not quite sure what you want to look for. You could find blank lines, but it would be difficult to differentiate between different non-blank lines.
Maybe using unique paragraph styles for each label? GREP can't find text in one style followed by another, but scripting can, I think.
-
6. Re: If text exists after merge insert preceding word? Conditional Grep?
Angus Hume May 23, 2013 9:43 PM (in response to P Spier)I was basically wanting to test if the line has text in it put in the label, if it's empty no label. I understood this would mean a separate paragraph style for each type. In the end I just added extra columns for the label names in excel and added extra field in Indesign.


