Auto Detecting delimiters

  • Thread starter Thread starter Victory
  • Start date Start date
V

Victory

Hi All,
Is there a way to automatically detect delimiters in a file. For
example, consider the following three files each with its own set of
item qualifier and delimiter:

1) "RS0000001","RS0000003","3","BOX001","EVRS01"
2) ^RS0000001^|^RS0000003^|^3^|^BOX001^|^EVRS01^
3) þRS0000001þþRS0000003þþ3þþBOX001þþEVRS01þ

Is there a way to automatically detect the delimiter, in the first line
comma is the delimiter, the second is the pipe character and the third
uses the ASCII 254.
thanks,
Mars
 
I figured it out. The way, i did this was to use the Split and detect
for the number of occurances of comma, pipe and box character and then
used the Math.Max to find the max, then used the switch or in VB the
case select and compared against the original counts.

Mars
 
No when it is about CSV than is the standard delimiter even culture setting
dependend.

Cor
 
Hi Cor,
Could you be more expressive, i did not understand your point, please
provide an example?
thx!
Mars
 
Back
Top