Have you considered using a proper RDMS instead?
In any case, your records are delimited by pipes?
Then what do you use to separate fields?
Without this kind of information it is difficult to give any pointers, and it usually is easier to use an RDMS anyway.