in reply to retrieving information from a set of files

How do you know where the account number is in a given file? If you have a header row, then the solution is easy, so I assume you don't. If that's the case, you will have to determine some way to tell where the account number is in a given file. For example, it sounds like your fields are fixed length. Are you guaranteed that the account number field will be the only field that is 9 characters long?

If you have to manually inspect each file to find the account number field, then I am not sure how you would expect to solve the problem progamatically.

  • Comment on Re: retrieving information from a set of files

Replies are listed 'Best First'.
Re^2: retrieving information from a set of files
by Anonymous Monk on Oct 20, 2006 at 21:43 UTC
    The account number is a fixed 9 digits that is always the first 9 digits in 7 of the files. For the remaining files also it is always in a fixed location on each line of the file.
      I forgot to note 1 additional comment: the number of fields may vary according to the file. Although my sample data illustrates only 3 columns, this is not true for the files I have.
Re^2: retrieving information from a set of files
by Anonymous Monk on Oct 20, 2006 at 21:52 UTC
    I've created some sample data to illustrate what i'm speaking of. I hope this helps?
    1 of 3 exception files look like this:
    234abc|00011|123456789
    224abc|01011|122456789
    244abc|10011|123356789
    254abc|11011|123446789

    Other 7 files are in this format:
    123456789|234abc|00011
    123456789|234abc|00011
    123456789|234abc|00011
    122456789|224abc|01011
    123356789|244abc|10011
    123356789|244abc|10011
    123446789|254abc|11011

    accts.txt
    123456789
    122456789
    123356789
    123446789