由Paul Hsieh和Michael B. Allen解析CSV? [英] CSV parsing by Paul Hsieh and Michael B. Allen?

查看:72
本文介绍了由Paul Hsieh和Michael B. Allen解析CSV?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

<一个相对= nofollow的 href =http://groups.google.com/group/comp.lang.c/browse_frm/thread/86a3ddf0724d9630/4e38340aa824bee0?lnk=gst&q=how+to+best +解析+ a + CSV& rnum = 1#4e38340aa824bee0target =_ blank> http://groups.google.com/group/comp....38340aa824bee0
http://tinyurl.com/29q4kf


Michael& Paul(或任何可以提供帮助的人):


我一直在寻找一个可靠的CSV解析实现和

找到上面的线程,其中包括指向程序由

你们两个人写的。


在我第一次尝试构建它们时,我失败了,我注意到了b $ b这两个实现似乎是为微软的b $ b b世界编写的,可能还有一些混合

环境(Cygwin或其他东西?)。


我希望在Linux下整齐地构建和编译这两个程序(每个程序都很有价值且非常有用)。 $ b所有其他* ix操作系统。在过去,我已经将这样的工作(具有不同级别的可构建性的OSS程序)移植到GNU的可靠解决方法中。

配置,(几乎)永远不会无法编译,构建和安装
。没有麻烦。


在我开始找到有问题的程序员的任务之前,我想知道这两个程序的当前状态是什么?哪里

是最接近Unix的源码(并且希望没有

任何Windowcism)?


任何提示和建议非常欢迎。


TIA,


-Ramon F Herrera
http://groups.google.com/group/comp....e14b3ea250e5/ #
http://tinyurl.com/2rknnd

解决方案

新闻:11 ********************** @ y5g2000hsa.googlegro ups.com,

Ramon F Herrera< ra *** @ conexus.netwrote:


我一直在寻找一个可靠的CSV解析实现和



....


欢迎任何提示和建议。
http://sourceforge.net/ project / showf ... roup_id = 127761 href =http://sourceforge.net/search/index.php?words= %28%2Bcsv +%2Bparser%29target =_ blank> http://sourceforge.net/search/index....v+%2Bparser%29


4月20日晚上10点16分,Ramon F Herrera< r ... @ conexus.netwrote:


Michael& Paul(或任何可以提供帮助的人):


我一直在寻找一个可靠的CSV解析实现和

找到上面的线程,其中包括指向程序由

你们两个人写的。


在我第一次尝试构建它们时,我失败了,我注意到了b $ b这两个实现似乎是为微软的b $ b b世界编写的,可能还有一些混合

环境(Cygwin或其他东西?)。


我希望在Linux下整齐地构建和编译这两个程序(每个程序都很有价值且非常有用)。 $ b所有其他* ix操作系统。在过去,我已经将这样的工作(具有不同级别的可构建性的OSS程序)移植到GNU的可靠解决方法中。

配置,(几乎)永远不会无法编译,构建和安装
。没有麻烦。


在我开始找到有问题的程序员的任务之前,我想知道这两个程序的当前状态是什么?



指向我程序的指针应该是最新的并且正常运行。

makefile适用于WATCOM C / C ++。但是,为* nux创建自己的

makefile应该是完全无足轻重的。你只需要编译

并从相应的

C文件中链接模块bstrlib.o和csvparse.o。官方Bstrlib库还在

中包含了这个解析器示例存档,其中包含Linux的makefile。


我的解析器的第一个版本实际上是基于这是迈克尔解析器的逻辑,但是正确性得到了显着提升。

然而,即便如此,它还远非完美。去年我做了一个总计

重写的程序,以匹配我从b
派生的正确的CSV语法。它似乎没有错误,速度很快,并且很容易理解。我不知道迈克尔的解析器是否正确

这些天(它曾经在读取引用的CR时失败),但它肯定是

不是在他原来写的时候。我认为他也可以正确阅读的列数限制了



[...]最新的地方更接近Unix的源码(希望没有任何Windowcism的
)?



对于我的,只有makefile有Windowcisms。 (实际是DOSisms)。

.c和.h来源是便携式的。


-

Paul Hsieh http://www.pobox.com/~qed/bcsv.zip
http://bstring.sf.net/




" Ramon F Herrera" < ra *** @ conexus.netwrote in message

news:11 ********************** @ y5g2000hsa.googlegro ups .COM ...
<一个相对= nofollow的 href =http://groups.google.com/group/comp.lang.c/browse_frm/thread/86a3ddf0724d9630 ?/ 4e38340aa824bee0 LNK = GST&安培; q =如何+最佳+解析+ A + CSV&安培; RNUM = 1#4e38340aa824bee0\" 目标= _blank> HTTP://groups.google.com/group/comp .... 38340aa824bee0
http://tinyurl.com/29q4kf


Michael& Paul(或任何可以提供帮助的人):


我一直在寻找一个可靠的CSV解析实现和

找到上面的线程,其中包括指向程序由

你们两个人写的。


在我第一次尝试构建它们时,我失败了,我注意到了b $ b这两个实现似乎是为微软的b $ b b世界编写的,可能还有一些混合

环境(Cygwin或其他东西?)。


我希望在Linux下整齐地构建和编译这两个程序(每个程序都很有价值且非常有用)。 $ b所有其他* ix操作系统。在过去,我已经将这样的工作(具有不同级别的可构建性的OSS程序)移植到GNU的可靠解决方法中。

配置,(几乎)永远不会无法编译,构建和安装
。没有麻烦。


在我开始找到有问题的程序员的任务之前,我想知道这两个程序的当前状态是什么?哪里

是最接近Unix的源码(并且希望没有

任何Windowcism)?


任何提示和建议是最受欢迎的。



如果你不喜欢Paul',你可以尝试我的。它在我的网站上模糊

逻辑树。但是我认为保罗已经做了更彻底的工作。我的

是jsut将数据导入学习工具。

Mine使用nan来表示丢失的数据字段,因此有两个不可避免的

用于生成和测试nans的非便携式线路。


-

免费游戏和编程好东西。
http://www.personal.leeds.ac.uk/~bgy1mm


http://groups.google.com/group/comp....38340aa824bee0
http://tinyurl.com/29q4kf

Michael & Paul (or anyone who can help):

I have been looking for a solid implementation of CSV parsing and
found the thread above, which includes pointers to programs written by
both of you.

In my first attempt at building them, I failed miserably, and I
noticed that both implementations seem to be written for the Microsoft
side of the world, with perhaps some allowance for a hybrid
environment (Cygwin or something?).

I would like to have both program (each one is valuable and very
useful in its own right) to build and compile neatly under Linux and
all other *ix OSs. In the past, I have given the job of porting
something like this (OSS programs of varied level of "buildability")
into the sure-fire method of GNU config, which (almost) never fails to
compile, build and install. No hassles.

Before I embark on the task of finding the programmer in question, I
would like to know what is the current status of both programs? Where
is the latest source which is closer to Unix (and hopefully devoid of
any Windowcism)?

Any tips and suggestions are most welcome.

TIA,

-Ramon F Herrera
http://groups.google.com/group/comp....e14b3ea250e5/#
http://tinyurl.com/2rknnd

解决方案

In news:11**********************@y5g2000hsa.googlegro ups.com,
Ramon F Herrera <ra***@conexus.netwrote:

I have been looking for a solid implementation of CSV parsing and

....

Any tips and suggestions are most welcome.

http://sourceforge.net/project/showf...roup_id=127761 which resulted
from http://sourceforge.net/search/index....v+%2Bparser%29


On Apr 20, 10:16 pm, Ramon F Herrera <r...@conexus.netwrote:

Michael & Paul (or anyone who can help):

I have been looking for a solid implementation of CSV parsing and
found the thread above, which includes pointers to programs written by
both of you.

In my first attempt at building them, I failed miserably, and I
noticed that both implementations seem to be written for the Microsoft
side of the world, with perhaps some allowance for a hybrid
environment (Cygwin or something?).

I would like to have both program (each one is valuable and very
useful in its own right) to build and compile neatly under Linux and
all other *ix OSs. In the past, I have given the job of porting
something like this (OSS programs of varied level of "buildability")
into the sure-fire method of GNU config, which (almost) never fails to
compile, build and install. No hassles.

Before I embark on the task of finding the programmer in question, I
would like to know what is the current status of both programs?

The pointer to my program should be up to date and functioning. The
makefile is meant for WATCOM C/C++. However, creating your own
makefile for *nux should be totally trivial. You just need to compile
and link the modules bstrlib.o and csvparse.o from their corresponding
C files. The official Bstrlib library also contains this parser in
the examples archive which includes a makefile for Linux.

The first version of my parser was actually based on the logic of
Michael''s parser, but significantly augmented for correctness.
However, even then it was far from perfect. Last year I did a total
rewrite of the program to match the correct CSV grammar that I
derived. It appears to be bug free, it is fast, and it is easy to
understand. I don''t have any idea if Michael''s parser is correct
these days (it used to fail at reading quoted CRs), but it certainly
was not at the time he original wrote it. I think his is also limited
in the number of columns that can be correctly read.

[...] Where is the latest source which is closer to Unix (and hopefully
devoid of any Windowcism)?

For mine, only the makefile has "Windowcisms" (actually DOSisms).
The .c and .h sources are portable.

--
Paul Hsieh
http://www.pobox.com/~qed/bcsv.zip
http://bstring.sf.net/



"Ramon F Herrera" <ra***@conexus.netwrote in message
news:11**********************@y5g2000hsa.googlegro ups.com...

http://groups.google.com/group/comp....38340aa824bee0
http://tinyurl.com/29q4kf

Michael & Paul (or anyone who can help):

I have been looking for a solid implementation of CSV parsing and
found the thread above, which includes pointers to programs written by
both of you.

In my first attempt at building them, I failed miserably, and I
noticed that both implementations seem to be written for the Microsoft
side of the world, with perhaps some allowance for a hybrid
environment (Cygwin or something?).

I would like to have both program (each one is valuable and very
useful in its own right) to build and compile neatly under Linux and
all other *ix OSs. In the past, I have given the job of porting
something like this (OSS programs of varied level of "buildability")
into the sure-fire method of GNU config, which (almost) never fails to
compile, build and install. No hassles.

Before I embark on the task of finding the programmer in question, I
would like to know what is the current status of both programs? Where
is the latest source which is closer to Unix (and hopefully devoid of
any Windowcism)?

Any tips and suggestions are most welcome.

If you don''t like Paul''s you can try mine. It''s on my website under Fuzzy
Logic Trees. However I think Paul has made a more thorough job of his. Mine
was jsut to get get data into the learning tool.
Mine uses nan to signal missing data fields, so there are two inevitable
non-portable line to generate and test nans.

--
Free games and programming goodies.
http://www.personal.leeds.ac.uk/~bgy1mm


这篇关于由Paul Hsieh和Michael B. Allen解析CSV?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆