0

I am wondering if it is possible to create a GREP Style (not search) to auto-format a consistent data set of info. Data example as follows:

XXX1X234-101    "UPAS"  WOVEN SPTWR JKT OFF WHITE

XXX1X234-6D6    "JAKLYN"    WOVEN SPTWR TOP BARE PINK

XXX1X234-6D6    "RUTHIE"    WOVEN SPTWR TOP BARE PINK

XXX1X234-101    "COLE"  WOVEN SPTWR JKT OFF WHITE

XXX1X234-9O2    "JAKLYN"    WOVEN SPTWR TOP ALABASTER

XXX1X234-001    "JAKLYN"    WOVEN SPTWR TOP BLACK

XXX1X234-101    "KURRA" WOVEN CITY PANT OFF WHITE

If needed, data consists of 12 char string then tab, followed by a string surrounded by quotations then tab, then another string of text then tab, and lastly one more string of text.

I am wondering if it can be formatted to this automatically:

XXX1X234-101
"UPAS"
WOVEN SPTWR JKT
OFF WHITE

XXX1X234-6D6
"JAKLYN"
WOVEN SPTWR TOP
BARE PINK

XXX1X234-6D6
"RUTHIE"
WOVEN SPTWR TOP
BARE PINK

Till the end of the data list. Each string instead of being tabbed in now in new line (not new paragraph; shift-tab)

Thank you in advance!

  • 2
    GREP Styles do not change characters, – usr2564301 Jan 29 '18 at 23:22
  • You could probably fake it by GREP-styling the tabs to some ridiculously high font size and tracking to make them wide enough that they would reach the end of the line and break the text… but why would you want to? This is clearly a search-and-replace job, not an on-the-fly formatting job; why do you want to avoid a search? – Janus Bahs Jacquet Jan 29 '18 at 23:51
  • To explain simply, the document's data is not handled by myself, but by another person unfamiliar with inDesign. So they just copy and paste the data and hand it back to me where I have to format it again. At the very least, maybe I will try your suggest @JanusBahsJacquet. Perhaps, the most annoyance is actually the tabs. I'm wondering if I can remove the tabs and just replace them a space done automatically. – John Jan 29 '18 at 23:55
  • Is it really so much of a hassle? If others handle the data file (I’m guessing a CSV file or spreadsheet?), then you’d have to re-import and reformat it after it’s been changed by them anyways, wouldn’t you? A GREP find-and-replace takes about ten seconds to do, at most. – Janus Bahs Jacquet Jan 30 '18 at 0:48
  • You mean shift+return? – Khalid Hussain Apr 5 '18 at 13:25
1

As it has been pointed by commentaries, Grep styles won't help you here.
I would personally also use Find/Replace to set things properly.

However, as a fast (and dirty) workaround, you could easily edit your paragraph style to set a tabulation value equal to your column value. This way, text after tab will be "pushed" to the next line.
Use nested styles (or grep styles) to format line 2 and the 3 characters after your dash.
It's a fast workaround, but it's not what I would call good practice since you can come up with situations (such as text wrapping graphic frame) that would mess up the whole thing.

Example for a 130 mm column width:

enter image description here

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.