首页 \ 问答 \ 用于查找和替换多个子文件夹中的文件的Bat脚本 - 将.java文件替换为特定文件夹中的.class文件(Bat script to find and replace files in multiple subfolders - replace .java files with .class files from specific folder)

用于查找和替换多个子文件夹中的文件的Bat脚本 - 将.java文件替换为特定文件夹中的.class文件(Bat script to find and replace files in multiple subfolders - replace .java files with .class files from specific folder)

我是Windows批处理脚本的新手..请帮助这个场景

我有如下文件结构::

dir1 :c:\ workspace \ changeset \ com \ folder

subfolder1

  • one.java

子-2

  • two.java

dir2 :c:\ workspace \ target \ class \ com \ folder

subfolder1

  • one.class

subfolder2

  • two.class

Subfolder3

  • three.class

需要查找和替换各个子文件夹中的dir1文件,即dir2文件中的one.java和two.java,即one.class和two.class(需要用特定文件夹中的.class文件替换某些.java文件)

非常感谢您的帮助。

谢谢Arjun


I am new to windows batch scripting .. please help on this scenario

I have file structures as below ::

dir1: c:\workspace\changeset\com\folder

subfolder1

  • one.java

subfolder-2

  • two.java

dir2: c:\workspace\target\class\com\folder

subfolder1

  • one.class

subfolder2

  • two.class

Subfolder3

  • three.class

Need to find and replace dir1 files in respective subfolders i.e one.java and two.java from dir2 files i.e one.class and two.class ( need to replace certain .java files with .class files from specific folder )

much appreciated for your help.

Thanks Arjun


原文:https://stackoverflow.com/questions/43408123
更新时间:2023-09-27 10:09

最满意答案

RealFloat意味着RealFrac意味着Real ,这又意味着Ord

换句话说,作为RealFloat实例的每种类型都必须Ord一个实例。 所以这两个函数都需要Ord (这就是你要使用的“ < ”运算符)。 但第一个无意义地需要一些东西来处理浮点数(例如cos函数)。

订单最重要的确很重要; 这是最大功能的全部要点 。 这是找到最大值。 没有订购,没有最大价值!

另一方面,通过使用RealFrac ,可以防止(例如)查找最大String ,因为String显然不是任何类型的浮点数。


RealFloat implies RealFrac which implies Real which in turn implies Ord.

In other words, every type that is an instance of RealFloat must also be an instance of Ord. So both of these functions require Ord (which is what defines the "<" operator that you're trying to use). But the first one pointlessly also requires a bunch of stuff to do with floating-point numbers (e.g., the cos function).

Order most certainly does matter; that's the whole point of a max function. It's to find the maximum value. Without an ordering, there is no maximum value!

By using RealFrac, on the other hand, you are prevented from (for example) finding the maximum String, since a String clearly isn't any kind of floating-point number.

相关问答

更多
  • RealFloat意味着RealFrac意味着Real ,这又意味着Ord 。 换句话说,作为RealFloat实例的每种类型都必须是Ord一个实例。 所以这两个函数都需要Ord (这就是你要使用的“ < ”运算符)。 但第一个无意义地还需要一些东西来处理浮点数(例如cos函数)。 订单最重要的确很重要; 这是最大功能的全部要点 。 这是找到最大值。 没有订购,没有最大价值! 另一方面,通过使用RealFrac ,可以防止(例如)查找最大String ,因为String显然不是任何类型的浮点数。 RealF ...
  • 我想它会来自如何处理复杂的数字。 atan2函数用于处理(x, y)坐标,但这对于复数值不起作用,因为两个复数值将表示与4个实数值相同的信息量。 atan2对于复数来说没有任何意义,但是atan2肯定会。 由于atan2对于任何使用角度的程序都是非常重要的功能,因此它在RealFloat位置很可能是由于实用性而非纯数学。 I imagine it would come from how to handle complex numbers. The atan2 function is meant to wor ...
  • 不可能得到你想要的确切语法,但有一些方法可以通过共享构造函数的方式一般定义“0和n”类型,然后使用数字文字作为抽象构造函数。 有限类型的包提供了一个类型参数化的元素,因此: x :: Finite 4 将是一个有四个居民的类型:0,1,2和3.如果你有一个Finite 4值类型Finite 4的值,你可以确定它是这四个值中的一个(或者像undefined或其他底部)。 你不能直接对它进行模式匹配,但你可以通过使用getFinite :: Finite n -> Integer将一个Finite 4投影到g ...
  • 要创建类似于scala中的代数数据类型,您应该使用密封特征。 sealed trait Base object A extends Base object B extends Base 然后你可以写上面指出的wingedsubmariner的顺序: implicit object baseOrdering extends Ordering[Base]{ def compare(a:Base, b:Base): Int = (a,b) match{ case (A,B) => -1 ...
  • 你几乎总是需要至少Eq来实现一个集合(或者至少能够编写一个Eq实例,无论是否存在)。 只有 Eq会给你一个可怕的低效率。 您可以使用Ord或Hashable来改善这Hashable 。 你可能想要做的一件事就是使用一个trie,它可以让你利用嵌套结构而不是经常对抗它。 你可以从看看generic-trie开始 。 这似乎没有为您的Array部件提供任何内容,因此您可能需要添加一些内容。 为什么Eq不够好 实现集合的最简单方法是使用列表: type Set a = [a] member a [] = Fal ...
  • import Data.Ord instance Ord Foo where compare = comparing bar 是我能想到的OTTOMH最简洁的版本。 略少简明,但更好的概括是 import Data.Function instance Ord Foo where compare = compare `on` bar import Data.Ord instance Ord Foo where compare = comparing bar is the m ...
  • 你在这里描述的不是订单关系 。 订单关系是: 反思性的 ,所有的价值观都小于或等于自身; 反对称:如果x小于或等于y且y小于或等于x ,则x等于y ; 传递 :如果x小于或等于y ,且y小于或等于z ,则x小于或等于z 。 你的定义不是传递性的。 事实上: S小于R , R小于P ,但S不小于P 因此,我强烈建议你不要使用Ord ,因为例如排序等使用这些不变量。 你可以做的是让它自动从Ord派生出来: data Hand = P | S | R deriving (Show, Eq, Ord) 然后定义一个 ...
  • 如果我们看一下Ord类的定义 ,我们看到: class Eq a => Ord a where compare :: a -> a -> Ordering (<) :: a -> a -> Bool (<=) :: a -> a -> Bool (>) :: a -> a -> Bool (>=) :: a -> a -> Bool max :: a -> a -> a min :: a -> a -> a 所以这意味着每一个类型a Ord a也意味着Eq a 。 所以支持Ord ...
  • Int就是你想要的: fact :: int -> int - > fact :: Int -> Int 因为在Haskell中,类型需要以cap开头。 编辑:感谢Yuras对此发表评论: 或者如果你想要你可以使用类型类: fact :: Integral a => a -> a 您可以根据需要命名类型变量,包括int 。 此外,如果您想要将阶乘定义为一般数字, Num可能更适合您的目的。 Int is what you want: fact :: int -> int --> fact :: In ...
  • 问题是Complex a仅在实例化RealFloat实例化Num 。 这就是Num实例被定义为: instance RealFloat a => Num (Complex a) where ... 由于*由Num定义,因此如果它是Num的实例,则只能在Complex a上使用* ,即如果a是RealFloat的实例。 那么为什么Num实例有这种限制? 这是因为这种方法: abs :: a -> a 即使它的两个分量都是整数,复数的绝对值也可以是非整数。 例如,1 + 1i的绝对值是√2。 因此无 ...

相关文章

更多

最新问答

更多
  • h2元素推动其他h2和div。(h2 element pushing other h2 and div down. two divs, two headers, and they're wrapped within a parent div)
  • 创建一个功能(Create a function)
  • 我投了份简历,是电脑编程方面的学徒,面试时说要培训三个月,前面
  • PDO语句不显示获取的结果(PDOstatement not displaying fetched results)
  • Qt冻结循环的原因?(Qt freezing cause of the loop?)
  • TableView重复youtube-api结果(TableView Repeating youtube-api result)
  • 如何使用自由职业者帐户登录我的php网站?(How can I login into my php website using freelancer account? [closed])
  • SQL Server 2014版本支持的最大数据库数(Maximum number of databases supported by SQL Server 2014 editions)
  • 我如何获得DynamicJasper 3.1.2(或更高版本)的Maven仓库?(How do I get the maven repository for DynamicJasper 3.1.2 (or higher)?)
  • 以编程方式创建UITableView(Creating a UITableView Programmatically)
  • 如何打破按钮上的生命周期循环(How to break do-while loop on button)
  • C#使用EF访问MVC上的部分类的自定义属性(C# access custom attributes of a partial class on MVC with EF)
  • 如何获得facebook app的publish_stream权限?(How to get publish_stream permissions for facebook app?)
  • 如何防止调用冗余函数的postgres视图(how to prevent postgres views calling redundant functions)
  • Sql Server在欧洲获取当前日期时间(Sql Server get current date time in Europe)
  • 设置kotlin扩展名(Setting a kotlin extension)
  • 如何并排放置两个元件?(How to position two elements side by side?)
  • 如何在vim中启用python3?(How to enable python3 in vim?)
  • 在MySQL和/或多列中使用多个表用于Rails应用程序(Using multiple tables in MySQL and/or multiple columns for a Rails application)
  • 如何隐藏谷歌地图上的登录按钮?(How to hide the Sign in button from Google maps?)
  • Mysql左连接旋转90°表(Mysql Left join rotate 90° table)
  • dedecms如何安装?
  • 在哪儿学计算机最好?
  • 学php哪个的书 最好,本人菜鸟
  • 触摸时不要突出显示表格视图行(Do not highlight table view row when touched)
  • 如何覆盖错误堆栈getter(How to override Error stack getter)
  • 带有ImageMagick和许多图像的GIF动画(GIF animation with ImageMagick and many images)
  • USSD INTERFACE - > java web应用程序通信(USSD INTERFACE -> java web app communication)
  • 电脑高中毕业学习去哪里培训
  • 正则表达式验证SMTP响应(Regex to validate SMTP Responses)