6 Replies Latest reply on Mar 25, 2014 5:34 AM by Orvgon

    Auto format textfile exported from database

    Orvgon

      Hello, Im working as a graphic designer and I just got a hard assignment. Im making sort of a catalogue with lots and lots of diffrent clubs listed. I get a textfile with all the information delivered like this:

       

      2320#CITY#1#Number#CLUB
      2320#CITY#1#Chartrad#Mars 1953
      2320#CITY#1#Charterpresident#53-54 N Lastname
      2320#CITY#1#Address#Location#Street1###zipcode#City
      2320#CITY#1#Meeting time#Day#12:00
      2320#CITY#1#Phone#xxxx#xxxxxx
      2320#CITY#1#Email#email@email.com
      2320#CITY#1#Webpage#http://www.gamlegamle.com
      2320#CITY#2#Title#Firstname#Lastname#xxx#xxxxxxx#email
      2320#CITY#2#Title#Firstname#Lastname#xxx#xxxxxxx#email
      2320#CITY#2#Title#Firstname#Lastname#xxx#xxxxxxx#email
      2320#CITY#2#Title#Firstname#Lastname#xxx#xxxxxxx#email

       

      The goal is to automate the process of formatting it. The first three columns are not going to be in the catalogue (2320#CITY#2#).

      This is what I want to achieve:

      http://forumbilder.se/DC7GU/formattest

       

      I´ve managed to import it to excel and get it a bit less overwhelming. The idea Im working on right now is to try and format it in excel and then import to indesign and link the styles.

      Any ideas?

       

      //Oscar Norling

        • 1. Re: Auto format textfile exported from database
          Willi Adelberger Most Valuable Participant

          Have a look on Text export as InDesign Tagged Text txt:

          1. Create a simple file formatted with the text styles you want to format it at the end. Keep that document.
          2. Export this text with placeholder text as InDesign Tagged Text .TXT. Each format has to appear at least once. (Not needed for nested styles.)
          3. Open the text now in a text editor.
          4. Read out the tags of the text, not of the defiition.
          5. Build up the export of your data base to add these tags you have learned in step 4 upon export from the DB.
          6. This export needs not to have the style definition, because it is still alive in your InDesign document. Only the tags have to include the text.
          7. Import the text in the previous created INDD file. Because of the tags every paragraph gets its styling according to the paragraph styles of that document.
          1 person found this helpful
          • 2. Re: Auto format textfile exported from database
            Orvgon Level 1

            Thanks for your reply!

             

            Does this mean I will have to paste the tags on each line in the source textfile? I dont have control over the database, thats the problem. My client is just sending this huge chunk of #-separated text.

             

            And, how do I automate the placement of the tabs?

            • 3. Re: Auto format textfile exported from database
              Willi Adelberger Most Valuable Participant

              Normally you can export data from a data base and transform it, like adding or trunceting text elements, formatting numbers, time and day and such things are best done upon file export from FileMaker or Access or whatever you use.

               

              Another possibility is exporting from a DB as XML. For InDesign you will need to transform that information with a XLST rule and you can import that transformed XML file into InDesign and tag XML tags to text styles in InDesign. If you cannot handle the export from the DB of the client I would choose this way.

               

              If you are the owner of the DB or at least have direct access to it you could consider the use of a special plugin which connects InDesign to the DB. With this solution you could rewrite changes from InDesign to the DB. This could be useful as you detect errors or you can make changes in the document and you want to repair that information in the DB for later use.

              • 4. Re: Auto format textfile exported from database
                Willi Adelberger Most Valuable Participant

                I have forgotten:

                Maybe that you can import your clients output in your own DB application and transform it there.

                With tabulators, what do you mean? If it is between "Email:" and the xxx@xxx.xx you can specify a paragraph style which contains "Email & Tabulator" as a numbered list without numbers, otherwise you could decode it as any normal letter.

                1 person found this helpful
                • 5. Re: Auto format textfile exported from database
                  Peter Spier Most Valuable Participant (Moderator)

                  You say you have this in Excel now? It looks like a perfect candidate for using Data Merge.

                   

                  From Excel you can save as tab-delimited text, or you can do a find/change operation on the original text file and convert the # to tab, then save again as plain text to use as the data source. All of the formatting is then done in your merge template file in ID.

                  • 6. Re: Auto format textfile exported from database
                    Orvgon Level 1

                    Thanks alot!

                     

                    This sounds really promising, I'll investigate it, looks like it just might do the trick.

                     

                    I'll let you know if it works or if I have any more questions.

                     

                    Thanks again for the help!