简体   繁体   English

我应该为这个简单的应用程序使用哪种编程语言?

[英]Which programming language should I use for this simple application?

I need to create a simple program/utility to parse a txt file (deleting blank rows, concatenating lines, etc) that runs in Windows XP and can be called from a Windows command line. 我需要创建一个简单的程序/实用程序来解析在Windows XP中运行的txt文件(删除空白行,连接行等),并且可以从Windows命令行调用。 What programming language/environment best fits this type of application? 哪种编程语言/环境最适合这种类型的应用程序?

Thanks, I hope I'm not being vague. 谢谢,我希望我不是模糊的。

perl是从头开始设计用于文本处理的

我会推荐Python

Perl也是我的第一个也是最后一个....我认为它是从头开始制作的。

For a zero-install option, albeit a bit fiddley, you could use good ole Batch Files. 对于零安装选项,虽然有点fiddley,但您可以使用好的批处理文件。 Here is an awesome resource for this 这是一个很棒的资源

Perl? Perl的? Python? 蟒蛇? C#? C#?

Really, any will do. 真的,任何人都会这样做。

perl or python may work well for you. perl或python可能适合你。

If it's a very simple problem, you may wish to take a look at sed or awk. 如果这是一个非常简单的问题,你可能希望看看sed或awk。

First I'd use a scripting language, because those are usually easier/faster to get used with. 首先,我使用脚本语言,因为这些语言通常更容易/更快。 And they are flexible and you don't need to compile things after each change, you can modify the code directly and just run it. 它们非常灵活,您无需在每次更改后编译内容,您可以直接修改代码并运行它。

Secondly I wouldn't use a general purpose language, like C# or Python. 其次,我不会使用通用语言,如C#或Python。 While they will do great, they are really not the right tool for the job. 虽然他们会做得很好,但他们真的不适合这份工作。 They have lots of APIs and lots of choices to choose from. 他们有很多API和很多选择可供选择。 They are also tied to a runtime/fx, that needs to be deployed to the target machine. 它们还与运行时/ fx绑定,需要部署到目标计算机。

Consider a "parsing" kind of language like Perl. 考虑一种像Perl这样的“解析”语言。 Or you may want to use something like PowerShell. 或者您可能想要使用PowerShell之类的东西。 But I think Perl will do just great. 但我认为Perl会做得很好。

正如其他人所提到的,Perl或Python是不错的选择,但是如果你不想安装任何其他东西,你可以将JavaSript与Windows Scripting Host一起使用,这比C / C ++或Bash Scripting(其他选项)要容易得多。需要额外的软件)。

I'd say Gawk though I don't know if anyone uses it under Windows. 我会说Gawk虽然我不知道是否有人在Windows下使用它。 (G)awks basic syntax is even easier to learn than Perl (you can learn most of it in a day), especially if you know any C-like programming language. (G)awks基本语法比Perl更容易学习(你可以在一天内学到大部分内容),特别是如果你知道任何类C语言的编程语言。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM