LAE

Welcome to the LAE community!  Please feel free to start a discussion in the discussion tab or join in a conversation.

Discussions

Members

Resources

Events

 View Only
  • 1.  Merging 2 files into 1 output delimited

    Employee
    Posted 08-03-2010 19:09

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: Kelvin

    Hi there

    I have 2 files one with the overall information for the file (eg who sent it, where to, date, time, number of records etc) and the other file has the specific records (eg name of customer, premise details, codes). I need to merge them so file one is at the top and file 2 is below it. Is there a way of doing this?

    Many Thanks


  • 2.  RE: Merging 2 files into 1 output delimited

    Employee
    Posted 08-04-2010 06:06

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: timonk

    Kelvin,

    Could you perhaps post a simple example of the two data files so we can see the full formats?

    Thank you
    Regards
    Timon Koufopoulos
    MDA Support.


  • 3.  RE: Merging 2 files into 1 output delimited

    Employee
    Posted 08-04-2010 14:25

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: Kelvin

    Hi there

    Attached are the 2 output files I have (named networktest and networktest1). The last file (networktest_requirement) is what I need so I can automatically update our systems.
    Attachments:
    networktest1.txt
    networktest.txt
    networktest_requirement.txt


  • 4.  RE: Merging 2 files into 1 output delimited

    Employee
    Posted 08-09-2010 11:34

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: timonk

    Kelvin,

    The situation you present has a couple of difficulties, but there are some options.

    First off, you cannot have data in LAE where 2 entirely different field sets sit literally on top of one another. So any file physically setup as your "...requirement.txt" file will fail to load.

    One option you have is to, instead of stacking the files, merging all the fields into one file, and attaching the meta-data record (networktest1.txt) to each of the actual data records (networktest.txt).

    1. Load each of your files individually using a Delimited File node.

    2. Useing a Lookup node, you essentially join the 2 files together, creating one file with all the data columns of both, and matching the single meta-data record to all the regular data records.

    I've attached a simple graph that does this using your data files. This still gives you the ability to add metadata to all your records, and process it in LAE.

    The only real option to create a file similar to the one you sent, would be to create a custom Python node to merge up the data however you saw fit. But you would have to handle the file with python nodes, because as I said above the standard nodes cannot handle multi-header data files.

    Regards
    Timon Koufopoulos
    MDA Support
    Attachments:
    Merged.zip