In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
I would like to share with you how batch processing is renamed according to the contents of the file. I believe most people don't know much about it, so share this article for your reference. I hope you will gain a lot after reading this article. let's learn about it!
First of all, I have a .dat file whose name is fixed and needs to be changed.
The content of the first line of .dat is: 10107xxxxxx, which means 2007.01.01, and the following x content is not fixed. If it is from January to September, the first character is empty.
Now we need to change the file name according to the contents of this line. For example, 10107XXXXXX, change to c01-0101.cvs.
110107xxxxxx, changed to c01-1101.cvs
Please tell me how to write this BAT file.
Analysis:
Read the first line to a variable
The fifth character of the area variable, you can judge whether it is 0 or not
1) if it is 0, take the first two digits of the variable as the month, otherwise take the first one and prefix 0 as the month
2) if it is 0, take 3-4 digits as the month, otherwise take 2-3 digits as the day
Answer:
@ echo offfor% I in (* .dat) do call: goren% igoto end:gorenset / p firstln=
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.