首页 \ 问答 \ 用最新日期提取文件(Extracting Files with newest date)

用最新日期提取文件(Extracting Files with newest date)

我试图将指定的XML数据从一个文件夹提取到另一个文件夹。

问题是我只需要最新的。 当前日期应该确定最新的XML文件。 例如今天:2017年4月20日

我的节目如下:

-----------------test.bat--------------
@echo off&pushd \\server5\Datapool
for /f %%a in ('dir /b ^| find ".xml"') do for /f %%A in ('type %%a ^| find /I "Marc" ^| find /I "BENZ231"') do copy %%a C:\Users\folder1
-----------------test.bat--------------

所以我的目标是只有在“Marc”+“BENZ231”匹配时才将最新的XML文件提取到另一个文件夹中。

顺便说一句:两个字符串“marc”和“benz231”在同一行上。


I'am trying to extract specified XML Data from one folder to another.

The problem is I only need the newest ones. The current date should determine the newest XML files. For example today: 04/20/2017

My scirpt as follows:

-----------------test.bat--------------
@echo off&pushd \\server5\Datapool
for /f %%a in ('dir /b ^| find ".xml"') do for /f %%A in ('type %%a ^| find /I "Marc" ^| find /I "BENZ231"') do copy %%a C:\Users\folder1
-----------------test.bat--------------

So my goal is to extract the newest XML files into another folder only if "Marc" + "BENZ231" match.

btw: both strings "marc" and "benz231"are on the same line.


原文:https://stackoverflow.com/questions/43509202
更新时间:2023-12-21 18:12

最满意答案

我第一次尝试使用dojo构建时遇到了这个问题。 它与文件的字符编码有关。 查看解压缩版本的字符编码(非源代码)。 将其与未构建源中的文件的字符编码进行比较,文件的编码是自定义构建。 要查看这是否是一个问题,(在chrome中)您可以强制浏览器以给定的编码呈现内容。 您可以尝试这样做,看看它是否真的是您遇到的问题。

对此(至少对我而言)的简单解决方案是在dojo脚本标记上设置charset

<script type="text/javascript" src="/path/to/dojo" charset="UTF-8"></script>

Dojo有 编码值得一看。

如果您在构建中使用shrinksafe ,您可能还需要在那里指定编码:

java -jar -Dfile.encoding=UTF8 shrinksafe.jar

I encountered this issue when first trying to use the dojo build. It has to do with the character encoding of the files. Check out the character encoding of an unzipped release (non source). Compare that to the character encoding of files in unbuilt source, and the encoding of files are a custom build. To see if this is an issue, (in chrome) you can force the browser to render the contents in a given encoding. You can try this to see if it is actually the issue you are having.

The easy solution to this (for me at least) was to set the charset on the dojo script tags

<script type="text/javascript" src="/path/to/dojo" charset="UTF-8"></script>

Dojo has a couple of pages on encoding that are worth taking a look at.

If you are using shrinksafe in the build, you may also need to specify the encoding there:

java -jar -Dfile.encoding=UTF8 shrinksafe.jar

相关问答

更多
  • 以下作品。 这有点丑,但它符合合同: NumberFormat nf = NumberFormat.getCurrencyInstance(); DecimalFormatSymbols decimalFormatSymbols = ((DecimalFormat) nf).getDecimalFormatSymbols(); decimalFormatSymbols.setCurrencySymbol(""); ((DecimalFormat) nf).setDecimalFormatSymbols(de ...
  • 看起来我需要在我的构建配置文件中设置它。 staticHasFeatures:{'dojo-sync-loader':1} 然后dojo.require()可用。 我不是肯定的,但可能需要这条相关的线来防止其他问题:'dojo-xhr-factory':1 Looks like I needed to set this in my build profile. staticHasFeatures: { 'dojo-sync-loader': 1 } Then dojo.require() is availa ...
  • 您不需要'customBase'标志来执行此操作。 您可以简单地使用其当前内容_plus覆盖dojo.js文件,并使用您自己的一些缓存模块。 dependencies ={ selectorEngine: "acme", layers: [ { name: "../dojo/dojo.js", dependencies: [ ... ] } } You do not need the 'customBase' flag to ...
  • 我为这种情况部署哪些CSS文件? 这是有条件的,如果一个页面使用特定的模块并且它有自己的CSS规则,那么包含它们。 这不是方法,而是从dojo.css(base,reset)开始,dijit.css(基础,布局和更多),nihilo.css(示例主题)和android.css(示例主题)将成为一个良好的基础 如果您想使用主题,请包含'basename',例如dojox / mobile / themes / iphone / iphone.css 例如,如果iphone.css没有'@import' 你使用 ...
  • 额外的文件和目录 我认为不删除它们是一种好习惯。 执行构建的原因是通过将所有使用的内容组合到一些(优选一个)javascript文件中来提高Web浏览器性能。 但是如果使用的文件(模块)未包含在图层中会发生什么。 如果构建目录中有其他文件,则应用程序仍然可以工作,您只需要另外调用服务器即可获取该文件。 如果您删除了这些目录和文件,您的应用程序将会中断。 拉过资源 做自定义构建后,我有一个 release/RELEASE_NAME/dojo/resources 目录,其中包含您提到的所有资源。 编辑:添加 ...
  • 看起来dojo.currency正在使用dojo.number.round,dojo.number.round使用javascript toFixed。 已知有浮点问题。 使用Math.round(数字* Math.pow(10,places))/ Math.pow(10,places)代替 Looks like dojo.currency is using dojo.number.round under the covers, and dojo.number.round uses the javascri ...
  • 我第一次尝试使用dojo构建时遇到了这个问题。 它与文件的字符编码有关。 查看解压缩版本的字符编码(非源代码)。 将其与未构建源中的文件的字符编码进行比较,文件的编码是自定义构建。 要查看这是否是一个问题,(在chrome中)您可以强制浏览器以给定的编码呈现内容。 您可以尝试这样做,看看它是否真的是您遇到的问题。 对此(至少对我而言)的简单解决方案是在dojo脚本标记上设置charset