Expert question: Data Merge and variables

Community Beginner ,
Mar 17, 2021 Mar 17, 2021

Copy link to clipboard

Copied

First, thank you for taking the time,

we have our data in a spreadsheet. We are using a font that has some really vital glyphs in it. Now we want to do the following:
Spreadsheet:
Text <variable>.

InDesign: 
Text @.

@Deleted User the glyph from the font.
We would need this, so the <variable> glyph would stay consistent during translations.

It is vital that the <variable>-part would be like stated in the spreadsheet.
 
 

Does anyone know how to do this? We know how to get the data formatted in the final sheet (it is just the variable part that won't work as expected).
Thank you!

TOPICS
Import and export

Views

117

Likes

translate

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct Answer

Explorer , Mar 19, 2021 Mar 19, 2021
Hi, Wyrmgold: Lets see if I understood the trouble because I have a solution to a similar problem. I must translate a lot of words in a data merged document. In my spreadsheet I use keywords like <day_sun>, <day_mon>, etc. that represents the day of the week. Then, to translate to diferent languages I use a script "FindChangeByList" (included in CS4 and CS5 as examples of javascript) which is able to do a lot of Search/Change operations including formatting. And, when there is a festive day, I m...

Likes

translate

Translate

Translate
Adobe Community Professional ,
Mar 18, 2021 Mar 18, 2021

Copy link to clipboard

Copied

Data Merge works by effectively referring back to a raw text file (whether it is comma separated, tab separated or semicolon separated) so the formatting part has to be done in the base ID file and not the data.

 

I'd simply make a character style that has the desired font and then apply it to the <variable> part of the text in the story.

Likes

translate

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Mar 18, 2021 Mar 18, 2021

Copy link to clipboard

Copied

Hi Wyrmgold,

do you talk about alternate glyphs like in this example I made up:

 

AlternateGlyphs-GlyphID.PNG

 

I see no way to do this for my made up job other than to do a couple of find/change actions plus a unique marker in the source text of your data merge text or csv file. What do I mean by that:

 

[1] Mark the character in your data merge source like that; I made up that pattern, use your own that fits your needs:

 

Do: Ra<@m> with Glyph ID 251
Not: Ram with Glyph ID 78

 

[2] After the data merge find <@m> and replace the whole expression with m together with a font you do not use elsewhere in your document and contains the glyph with the same glyph ID you are looking for. You can use Text Find/Change or GREP Find/Change for this; whatever fits your needs and pattern of your unique marker.

In my sample I would change the font to a variant of Minion Pro I do not use elsewhere in the document; eg. Minion Pro Condensed Bold…

 

[3] Then in a second step use Glyph Find/Change to look after that unique font and replace glyph m with ID 78 with the desired glyph, in my case glyph m with ID 251:

 

AlternateGlyphs-GlyphID-FindChange.PNG

 

The result is this:

AlternateGlyphs-GlyphID-FindChange-Result.PNG

 

Regards,
Uwe Laubender

( ACP )

Likes

translate

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Mar 18, 2021 Mar 18, 2021

Copy link to clipboard

Copied

Hello Uwe Laubender,
thank you.

I will post a few pictures, so you can better understand what I am trying to achieve.
Our current data is entered in an Apple Numbers sheet (which we would love to replace with Google Sheet for workflow purposes). Unfortunately in Google Sheets custom fonts (like our self-made glyphs) are not supported - this would mean the (game) designer would have to write "å" or other characters while changing game definitions (which is understandably not the best idea). Hence we want to make them variables like <influence> that would be changed to the according glyph like "å" (best case) in InDesign without a manual Find/Replace.
 The Sheet in Numbers (with the custom glyphs)Bildschirmfoto 2021-03-18 um 18.31.00.png

Making the Sheet like this (for Google Sheet):
Bildschirmfoto 2021-03-18 um 18.37.32.png

And in the end we would get the layout we have here (this is already working, but only with Numbers):
PAG_BAS_HUN_001.jpg

We have the workflow going - but only with the data being inserted on a Mac with Numbers. These cards change regularly, and we want to make sure the designer can use the <variables> without having to memorize which special character is used. My idea was that we could use text variables, but it seems they have to be inserted manually. Maybe I just don't know the syntax for them. Is there maybe something I am missing? Or is GREP (e.g.) the best way to do it?

Thank you,
Alexander

Likes

translate

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Mar 18, 2021 Mar 18, 2021

Copy link to clipboard

Copied

Hi Alexander,

thank you for the detailed info.

 

Hm, hm, hm…

If the custom glyphs would use Unicode numbers in the so called Private Use Areas you wouldn't need to change anything at all. No need for that "<variable> glyph" construction, as you call this. The data source for data merge would transport the special characters' Unicode values to InDesign and one single GREP Style would format the characters with the right font.

 

Did you consider to built a Unicode font that is using Private Use Areas?

https://en.wikipedia.org/wiki/Private_Use_Areas

 

Could be done with Jongware's and Marc Autret's IndiFont script with InDesign as authoring tool for example:

https://www.indiscripts.com/category/projects/IndyFont

 

Of course there is the question of how to type the special characters in the first place.

 

Regards,
Uwe Laubender

( ACP )

Likes

translate

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Mar 19, 2021 Mar 19, 2021

Copy link to clipboard

Copied

Hi Uwe,
thanks for the answer. Yes, the main problem is not the transport of the special characters from the data into indesign (as I said it works with Numbers in an editable form - just Google Sheets is not supporting custom fonts - and we need to use sth like Google Sheets because our team is decentralized).
I wanted to use text variables, so InDesign would change them to the glyphs when building the final document (but it does not recognize the variables from the data sheet as text variables I guess).
If it works the game designer/translator could use their wording and I could easily automate the process (as we have several hundred cards and different languages). I think we will have to do a step in between (GREP or sth). 

Thank you all for your help! 

Likes

translate

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Mar 19, 2021 Mar 19, 2021

Copy link to clipboard

Copied

Hi, Wyrmgold:

 

Lets see if I understood the trouble because I have a solution to a similar problem.

 

I must translate a lot of words in a data merged document. In my spreadsheet I use keywords like <day_sun>, <day_mon>, etc. that represents the day of the week.

 

Then, to translate to diferent languages I use a script "FindChangeByList" (included in CS4 and CS5 as examples of javascript) which is able to do a lot of Search/Change operations including formatting. And, when there is a festive day, I must change his color too, so I need to apply a different character style. I do this with several languages, across several pages, across several templates.

 

So is possible to change a match to a character style that has your gliph font. Across several matches. Across several cards.

 

Let's to do it (maybe will be useful for me tomorrow 😉

 

You need two scripts that come with InDesign script examples. "RecordFindChange" and "FindChangeByList". Well, the first one is optional if you use my own example here as template (they camo for sure with CS4 and CS5, if not, internet search and a bit of lucky is requiered).

 

The first script (RecordFindChange) saves a text file with the actual search parameters set in the last "Find/Change" operation. You can edit that file, is quite intuitive. A single line represents one find/replace operation, so if you duplicate that line 100 times with different searches, you improve the whole replacement process.

 

The second script demands a text file in the format as RecordFindChange gives, with the parameters of each replacement.

 

Let's take a look to a one line search:

 

text	{findWhat:"<e>"}	{changeTo:"<F028>", appliedCharacterStyle:"myGliph"}	{includeLockedStoriesForFind:false, includeLockedLayersForFind:false, includeHiddenLayers:false, includeMasterPages:false, includeFootnotes:true, wholeWord:false, caseSensitive:false, kanaSensitive:true, widthSensitive:true, ignoreKashidas:true, ignoreDiacritics:false}	//Comment

 

Notice there is a <tab> character between "text" and "{findWhat..." and also between every "}   {"

 

When you run FindChangeByList and select a text file containing this line, InDesign replace all the text in the document that match my code "<e>" and replace it with the unicode character "<F028>", and inmediately apply the character style "myGliph". Use a text editor, duplicate the line avobe as needed and put your own codes and names.

 

Remember: one entire line, one search/replace operation. Separe the lines with extra carriage returns for a clear view of each bloc (the lines are quite long)

 

In order to work properly, you must have a character style named "myGliph" (in this example, you can use your owns).

You set here the font you use to print you amazing glyps

 

One last tip: you can change the false/true statments to adjust the behaviour of you change operation

 

And I think that's all. Sorry if that was not the problem you propose to solve.

 

Likes

translate

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Mar 19, 2021 Mar 19, 2021

Copy link to clipboard

Copied

Thank you! I was just thinking of a solution when the Java script / GREP combination was told to me by a friend! So Kudos to you and I got it to work in minutes now! Thanks to all you amazing creatives! 

 

Cheers, I am happy again! 
Alexander

Likes

translate

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines