in reply to Re: Splitting file into separate files based on record lengths and identifiers
in thread Splitting file into separate files based on record lengths and identifiers

Thank you for posting code - now I better understand your coding abilities and can give you specific critiques. I ran your code, as posted, against your posted sample input and it seems to have functioned as per spec. What makes you think it broke?

As a side note, there is no need to explicitly close your files. Since you've used Indirect Filehandles, Perl with automatically clean those up once the variables got out of scope.

  • Comment on Re^2: Splitting file into separate files based on record lengths and identifiers

Replies are listed 'Best First'.
Re^3: Splitting file into separate files based on record lengths and identifiers
by monty77 (Initiate) on Aug 25, 2010 at 22:09 UTC

    This is the data that breaks my original script:

    0002*330004%19770004$BOB 0002*430004%1967

    ...it results in spitting this into the dollar.txt file and nothing into the other two.

    0002*330004%BOB 0002*430004%1967

    Thanks!