Ignoring partial line data in non-delimted fixed-field files

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • daneo
    New User
    • Jun 2015
    • 2

    Ignoring partial line data in non-delimted fixed-field files

    Dear BC Team,

    I'm evaluating using BC4 for a project, and am trying to figure out how to ignore only part of a line. The data set is a flat SAP IDoc - all fixed-length fields and no delimeters. When testing IDocs, you will need to ingore the date/time which is generally the last 14 characters or so of the record, but want to compare other data elements and qualifiers.

    Code:
    EDI_DC40  800                40B 3023  ORDERS01                                                    ORDERS                              ED.96A ORDERSSUBSYSTEM KU  7777                                                                                                 SAPMAT    LI  0000001014                                                                                           19991001113855                                                                                                                                    E2EDK01003                    800                                  DEM   0.52980                                                              NB  4500016447                                                                                                                                                                                                                                                     E2EDK14                       800                              0081000
    For example, the first record starts with EDI_DC40 and goes for approx 524 characters. I want to evaluate all records on such a line up to the date/time (here in this example it's "19991001113855" however I'm not sure how to made that happen. You can see that the EDI_DC40 record is padded out to the beginning of the E2EDK01 record.

    The example above has actually 3 records (EDI_DC40, E2EDK01 and E2EDK14) -- so being able to ignore part of a file along the lines of

    After you find EDI_DC40, compare for 142 characters, then ignore the next 14, then start comparing again. After you find E2EDK01, compare until the next keyword comes.

    Doing this with XML IDocs is pretty easy as the DTM fiels are cleanly delimited, but in the flat ones it's a nightmare.

    Any suggestions?
  • Aaron
    Team Scooter
    • Oct 2007
    • 16000

    #2
    Hello,

    There are two main ways to tackle this scenario. You mention that the file is Fixed Length fields. If this is easily definable, our Table Compare session supports fixed length columns. You can define this in the Tools menu -> File Formats, create a new Table format, Type tab, and select Fixed. Then define the columns with numeric semicolon delimited list: 524;142;8;64;123 and so on. If this type of definition works, opening your files in the Table Compare with this format will place each text section in its own column. Leaving the Date column in a single column then lets you mark that column as Unimportant. This also allows setting a Key column to sort and align your rows by.

    Otherwise, you can use our Text Compare, and would need to define a Regular Expression that matches on the date string. Would it be possible to use a mask that matches on that exactly record length of only numerals? Something like:
    \s\d{14}\s
    We have a configuration KB article and video here:
    http://www.scootersoftware.com/suppo..._unimportantv3
    Aaron P Scooter Software

    Comment

    Working...