Re myauto: Judging purely from your description, it is impossible to get enough constraints. For example, if we take “extract 2004121606.014 and assign it to a variable” literally, it does not seem to mean much, because it would seem that just set var=2004121606.014 would be enough. But what you clearly mean is not that, so please consider the following questions and provide appropriate constraints.
How is your text line determined? Is it determined before running by a user looking at the output, or during runtime by the program analyzing the output? What characteristics does your text line have? Is it simply a numeric line, or are there other characteristic strings before and after the number? What kind of information do you want to extract from the text line? The whole line of text, or just the numeric information, non-numeric information, or some other distributed information? This is the kind of information that should be provided when asking this sort of question. If there are other issues you think are necessary, please explain them in advance as well, because differences in this information can lead to very large differences in the solution program. And for batch files, handling a specific problem is always easier than handling a whole class of problems. If you want a general-purpose program, please also consider beforehand the cost of writing such a program, including a long wait, imperfect code, or even ending up with nothing.
※ Batchinger 致 Bat Fans:请访问
批处理编程的异类 ,欢迎交流与共享批处理编程心得!