def read_recon_in(in_file):
    """ Reads the input file, then returns lists of lines for each group of
        input data.

        Finds the appropriate headers as described in the file specification,
        then splits out the position data and transaction data.

        Parameters:
            in_file (str): Path to the input file
        Returns:
            d0_pos, d1_trn, d1_pos: Lists of strings containing position data
                (d0_pos, d1_pos) and transaction data (d1_trn)
    """

    with open(in_file, 'r') as f:
        lines = [line.rstrip() for line in f]

    d0_pos_header = lines.index('D0-POS')
    d1_trn_header = lines.index('D1-TRN')
    d1_pos_header = lines.index('D1-POS')

    d0_pos = lines[d0_pos_header + 1:d1_trn_header - 1]
    d1_trn = lines[d1_trn_header + 1:d1_pos_header - 1]
    d1_pos = lines[d1_pos_header + 1:]

    return d0_pos, d1_trn, d1_pos