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.  Reading the rest of the line with Fixed Format File

    Employee
    Posted 06-06-2013 20:38

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

    Originally posted by: Patman

    Hi, I have a file containing lines of varying length. There are only 2 fields. Code (len: 4), Fields (len: varies).
    In the fields position, what do I put in the 3rd parameter to tell I want to read the rest of the line.

    Is there a cleaner way to do this other than using a very high number?


    CODE,0,4
    FIELDS,4, <until end of line>


  • 2.  RE: Reading the rest of the line with Fixed Format File

    Employee
    Posted 06-19-2013 06:38

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

    Originally posted by: rboccuzzi

    I think given the mixed fixed/variable size of your data, I would read it in using a delimited file node. Use a field delimiter that you know does not occur in the data, and you will get a single field out (you probably want to provide the name in the node of that field. Once you do this, you can parse it easily with a filter node, where you can drop the first record (if it is a header you don't need), and then parse the record using the BRAINscript split function.

    It is a good enhancement request to be able to specify a final field which is the "rest of the line" in the fixed file format, so I have recorded that as issue 5006.

    Cheers
    Rich