+ Reply to Thread
Results 1 to 5 of 5

Combine 2 .csv files and sequential transpose into excel question

  1. #1
    Registered User
    Join Date
    04-03-2015
    Location
    California
    MS-Off Ver
    MS Office 2011
    Posts
    4

    Combine 2 .csv files and sequential transpose into excel question

    Hi All,

    I'm looking for a way to (using a macro/vba/etc.?) combine data from (2) .csv files and adhere to a specific layout for importing as a single .csv file.

    For example, 2 .csv files would look like this:

    File #1: P7,C4,C5,C6,C7,C8,C9,C10,C11,C12,C13,C14,C12
    File #2: C4,S1,S2,S3,S4,S5
    1 (P)ackage has 12 (C)artons and each Carton has 5 (S)tickers affixed.

    For this example, for the number of P items, n=1, the number of C items, n=12. And the repeating S items, n=5.
    Ideally, I'd like to make this a dynamic query where there number of P, C and S items varies.

    The desired results (as a single .csv file) would look like this:

    P7 C4 S1
    P7 C4 S2
    P7 C4 S3
    P7 C4 S4
    P7 C4 S5
    P7 C5 S1
    P7 C5 S2
    P7 C5 S3
    P7 C5 S4
    P7 C5 S5
    P7 C6 S1
    P7 C6 S2
    P7 C6 S3
    P7 C6 S4
    P7 C6 S5
    ... ... ...
    ... ... ...
    P7 C15 S1
    P7 C15 S2
    P7 C15 S3
    P7 C15 S4
    P7 C15 S5



    the "..." above accounts for the continuation from P7 C7 S1 to P7 C14 S5


    Thanks!

    Mike

  2. #2
    Forum Contributor
    Join Date
    01-14-2014
    Location
    London, England
    MS-Off Ver
    Excel 2013
    Posts
    240

    Re: Combine 2 .csv files and sequential transpose into excel question

    Can you upload the 2 CSV files - taking anything sensitive out? This looks at the outset as a straight SQL / MS query problem - minimal VBA / Macro.
    Please consider adding a * if I helped.

  3. #3
    Registered User
    Join Date
    04-03-2015
    Location
    California
    MS-Off Ver
    MS Office 2011
    Posts
    4

    Re: Combine 2 .csv files and sequential transpose into excel question

    Thanks, Brandon. I've attached the (2) .txt files (which I import into Excel). These (2) files are can be either .txt or .csv.

    Please let me know if you need any other info and thank you for your help!

    Cheers,
    Mike
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    04-03-2015
    Location
    California
    MS-Off Ver
    MS Office 2011
    Posts
    4

    Re: Combine 2 .csv files and sequential transpose into excel question

    Hi Brandon, Any luck on solving this question?

    Cheers, Mike

  5. #5
    Registered User
    Join Date
    04-03-2015
    Location
    California
    MS-Off Ver
    MS Office 2011
    Posts
    4

    Re: Combine 2 .csv files and sequential transpose into excel question

    Hi Brandon,

    Were you able to answer my question an an outset as a straight SQL / MS query problem - minimal VBA / Macro?

    Thanks,
    Mike

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Excel vba to tel adobe combine two pdf files based on a spcified list of files
    By Abbadon486 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-30-2014, 12:04 PM
  2. [SOLVED] Transpose column sections into sequential rows of new sheet, Macro help
    By ImmunoNut in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-12-2012, 01:11 AM
  3. Replies: 1
    Last Post: 11-12-2009, 02:16 AM
  4. Excel Transpose Question
    By Chris2008 in forum Excel General
    Replies: 6
    Last Post: 10-31-2008, 12:41 AM
  5. [SOLVED] Another combine two files question....
    By Dust Bun in forum Excel General
    Replies: 1
    Last Post: 08-09-2005, 05:05 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1