3 Replies Latest reply: Aug 31, 2017 2:28 PM by Felip Drechsler RSS

    Loading multiple CSV files from Data Inbox

    Brian Head

      Hi,

       

      I'm trying to create a very simple program to compare two files (based on an ID variable)--the files are getting too big for Excel. I've loaded two CSV files in a data inbox. I can import either one individually with no problem. However, when I try to import both upon load I'm told the second doesn't exist. Below is the code for the first file. The second is exactly the same exept it has "File2_temp." I cannot find an existing thread on this. Is there a command I need to use? I tried 'noconcatenate' but that didn't make any difference.

       

      //*******************************************************

      File1_temp:

      LOAD

          DONOR_ID,

          TITLE,

          FIRST_NAME,

          MIDDLE_NAME,

          LAST_NAME,

          SUFFIX,

          OPT_LINE,

          ADDRESS,

          ADDRESS2,

          CITY,

          STATE,

          ZIP,

          SALUTATION,

          IN_AMT,

          INITIAL_GIFT_DATE,

          LAST_CONTRIB_AMT,

          LAST_CONTRIB_DATE,

          MAX_AMT,

          MAX_DATE,

          GIFTS

      FROM [lib://Data Inbox - Marketing/USAM1708 Final for Vendor.csv]

      (txt, codepage is 28591, embedded labels, delimiter is ',', msq);

       

      Any suggestions are appreciated.

        • Re: Loading multiple CSV files from Data Inbox
          Felip Drechsler

          Hi Brian

           

          The second table won't "exist" because it it automatically concatenated into the first load because both files share the same number of fields and same name (have the same structure).

           

          Do something like:

          File1_temp:

          LOAD

              DONOR_ID,

              TITLE,

              FIRST_NAME,

              MIDDLE_NAME,

              LAST_NAME,

              SUFFIX,

              OPT_LINE,

              ADDRESS,

              ADDRESS2,

              CITY,

              STATE,

              ZIP,

              SALUTATION,

              IN_AMT,

              INITIAL_GIFT_DATE,

              LAST_CONTRIB_AMT,

              LAST_CONTRIB_DATE,

              MAX_AMT,

              MAX_DATE,

              GIFTS

          FROM [lib://Data Inbox - Marketing/USAM1708 Final for Vendor.csv]

          (txt, codepage is 28591, embedded labels, delimiter is ',', msq);

           

          NoConcatenate

          File2_temp:

          LOAD

              DONOR_ID,

              TITLE,

              FIRST_NAME,

              MIDDLE_NAME,

              LAST_NAME,

              SUFFIX,

              OPT_LINE,

              ADDRESS,

              ADDRESS2,

              CITY,

              STATE,

              ZIP,

              SALUTATION,

              IN_AMT,

              INITIAL_GIFT_DATE,

              LAST_CONTRIB_AMT,

              LAST_CONTRIB_DATE,

              MAX_AMT,

              MAX_DATE,

              GIFTS

          FROM [lib://Data Inbox - Marketing/USAM1708 Final for Vendor.csv]

          (txt, codepage is 28591, embedded labels, delimiter is ',', msq);

           

          It will generate a syntethic key this way, because they're basically the same file, only having different values.


          Felipe.