You are here: Re: how to find seperator in a csv-file « All PHP « IT news, forums, messages
Re: how to find seperator in a csv-file

Posted by Oli Filth on 01/10/06 14:29

nescio wrote:
> hello,
>
> in a csv-file the field delimiter is mostly this: ','
> (that is why they call it csv i suppose)
>
> but people can use every sign they please.
>
> my problem is this: how can i find the field delimiter they use?
> in a csv-file?
>

I can't see how you could find this out automatically. If you don't
know what you're looking for, then how are you going to be able to find
it?

i.e. if you don't know what character you're looking for, how are you
going to identify that character?


> (i have an application that workst with a lot of different csv-files;
> people can choose from a listbox the field delimiter for the file they have
> chosen;

That's how Excel does it, for instance.


> but i want to check if the delimiter they choose is the same as in the
> csv-file)

I guess you could call fgetcsv() with the specified delimiter, and if
it returns FALSE then you know it didn't work.


--
Oli

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация