In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-14 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly explains the "C++ how to add all the txt under a directory in the third line of the fourth number", the article explains the content is simple and clear, easy to learn and understand, now please follow the editor's ideas slowly in depth, together to study and learn "how C++ add all the txt in the third line of the fourth number" it!
The code is as follows:
@ echo off
:: add the third line and the fourth number in all the txt under a directory
::
Set num=0
Setlocal enabledelayedexpansion
In fact, using skip=2 to skip the first two lines is more efficient.
For% I in (* .txt) do (
Set file=%%i
For / f "tokens=1* delims=:" j in ('findstr / n.! fileholders') Do (
Set var=%%k
If% j equ 3 (set numbness, var set!) & & set / a numb num, num!
)
)
The result of echo addition is% num%
Pause
Goto: eof
@ echo off
:: add the numbers in the tenth row and the third column in all the txt files in a directory
:: code by jm 2006-9-9 CMD@XP
Setlocal enabledelayedexpansion
For% I in (* .txt) do (
Set file=%%i
Set count=0
For / f "skip=9 tokens=3" j in (! file!) Do (
Set / a count+=1
If! count! Equ 1 set / a sum+=%%j
)
)
The result of echo addition is% sum%
Pause
Thank you for your reading, the above is the content of "how C++ adds the third line and the fourth number in all the txt under a directory". After the study of this article, I believe you have a deeper understanding of how C++ adds the third line and the fourth number in all the txt under a directory, and the specific use still needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!
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.