in reply to delimited files
Here is a possible idea that could work (I'll leave it up to you to implement it)
Assumption: one record is stored on each line (or you know exactly how many lines define one record).
Idea: Create a hash which represents the charachters and the numbers of lines they appear on. (Which means: read the file record per record, and add 1 to the correct hash-element for each unique charachter).
Now look for the charachters that occurs on every line. (meaning loop the hash and look for the elements where the value equals the total number of lines (after excluding alphanumeric charachters etc))
Now when you are done with that, then you might or might not be there yet. As in, what if there are two charachters that appear on every line? A solution for this could be that you try each charachter as a delimiter, and count how many fields you get... if there is a big difference in the number of fields then there is a big chance you used the wrong delmiter (except ofcourse when the data is really strange)
|
|---|