使用.bat文件阅读从.xls文件的值 [英] Read a value from a .xls file using .bat files

查看:821
本文介绍了使用.bat文件阅读从.xls文件的值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我只是想知道是否有可能是任何方式,我们可以使用一个.bat文件读取.xls文件的值。
对于例如:如果我有是有两列的.xls命名TEST.XLS
即EID,然后邮件ID'.Now当我们给了输入的.xls的EID name.it应提取对应于EID邮件ID和回声的结果了。

I just want to know if there could be any way by which we can read a value from an .xls file using a .bat file. For eg:If i have an .xls named test.xls which is having two columns namely 'EID' and then 'mail ID'.Now when we give the input to the .xls the EID name.it should extract the mail id which corresponds to the EID and echo the result out.

**EID**                  **MailID**
E22222                    MynameisA@company.com

E33333                    MynameisB@company.com

...
...

因此​​,通过上面的表格,当我用我的.bat文件为E22222给输入到xls文件,它应该阅读相应的邮件ID作为MynameisA@company.com,它应该呼应的价值。

So by the above table,when i give the input to the xls file using my .bat file as E22222,it should read the corresponding mail ID as MynameisA@company.com and it should echo the value.

所以,我希望我能够present我doubt.Please打电话给我更多的说明。

So i hope i am able to present my doubt.Please get back to me for more clarifications.

感谢和问候
马迪

Thanks and regards Maddy

推荐答案

有没有设施,直接与传统的.bat 文件做到这一点。但是,您可能调查 PowerShell的的,其目的是能做这样的事情。 PowerShell的与现有的Windows应用程序(如Excel)集成好,可以提供你需要轻松做到这一点的工具。

There is no facility to do this directly with traditional .bat files. However, you might investigate PowerShell, which is designed to be able to do this sort of thing. PowerShell integrates well with existing Windows applications (such as Excel) and may provide the tools you need to do this easily.

一个快速搜索打开了这个<一个href=\"http://blogs.msdn.com/krishkp/archive/2008/03/06/powershell-script-to-access-an-excel-file.aspx\"相对=nofollow>例如,从PowerShell的读取Excel文件。

A quick search turned up this example of reading Excel files from PowerShell.

这篇关于使用.bat文件阅读从.xls文件的值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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