Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

data merge text wrangler

Guru ,
Oct 27, 2017 Oct 27, 2017

Hi,

i have a data merge i am doing, i saved my  excel file as a .csv, but none of the commas show.  I am using textwrangler and i was wondering if anybody knew how to do a grep search to add a "," after each line break? i added a screenshot below so you can see what i see. i have lots of lists and i am looking for a fast way to add the commas from text wrangler.

Thanks

Screen Shot 2017-10-27 at 1.09.31 PM.png

972
Translate
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

Community Expert , Oct 27, 2017 Oct 27, 2017

This GREP code will add a comma to the end of every line without having to do a two-step procedure:

Screen Shot 2017-10-28 at 05.55.31.png

However, I agree with Jongware, why would you want to do this? If the database has one field, it doesn't need commas, the end of line tells ID's Data Merge that the record has ended and to begin another one.

Translate
Mentor ,
Oct 27, 2017 Oct 27, 2017

What if copy/paste everything in a fresh indd doc, do a grep here, and paste the resulting text back?

Translate
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
Guru ,
Oct 27, 2017 Oct 27, 2017

hmm. i was hoping to knock it all out from text wrangler at one shot.

i am doing this first:

regex - How to replace line-breaks with commas using grep in TextWrangler? - Stack Overflow

that removes teh breaks, so i do next:

Google Groups

and than i get to where i want to be. and move on to the next list. was just curious as to been able to do it all in one shot so i can work my way down all of the .csv files first, get them prep, and move on to indesign and data merge next.

Translate
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 Expert ,
Oct 27, 2017 Oct 27, 2017

This GREP code will add a comma to the end of every line without having to do a two-step procedure:

Screen Shot 2017-10-28 at 05.55.31.png

However, I agree with Jongware, why would you want to do this? If the database has one field, it doesn't need commas, the end of line tells ID's Data Merge that the record has ended and to begin another one.

If the answer wasn't in my post, perhaps it might be on my blog at colecandoo!
Translate
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
Guru ,
Oct 27, 2017 Oct 27, 2017

i did not know that. i have always done commas. good to know. thank you.

Translate
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 Expert ,
Oct 27, 2017 Oct 27, 2017

The text file saved from Text Wrangler can be used in a data merge.

Translate
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 Expert ,
Oct 27, 2017 Oct 27, 2017

I don't get it. If you replace every line break with a comma, then you have everything on a single long line. How is that better?

Translate
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
Guru ,
Oct 27, 2017 Oct 27, 2017

i watched video how the guy had a data merge and he has a .csv file with commas at the end of the entry. that was last year and ever since i had done it that way.

Translate
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 Expert ,
Oct 27, 2017 Oct 27, 2017

if there is more than one field in a database, then there needs to be a separator between the fields. For the data that InDesign can import, CSV will use a comma while TXT will use a tab. The latter is my preference as it allows me to keep commas within a record without a sea of quotation marks to indicate where a field should/should not start.

The header row also dictates how many fields will appear. Take the following example:

title

john,joseph,

joanne,mary,leanne,sarah,

cat,bird,

dad,budgie,

champ,is,a,dog

colin,,

If I save this as a csv or txt file and select it as a data source to InDesign, note how only the first field is imported, despite data being present in other fields:

Screen Shot 2017-10-28 at 06.24.46.png

If the answer wasn't in my post, perhaps it might be on my blog at colecandoo!
Translate
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
Guru ,
Oct 27, 2017 Oct 27, 2017
LATEST

ahhhhhhhhhh... i did not know you could get away with that. i been formatting this more than needed. Thank you

Translate
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