In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-27 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article is about how to use batch processing to multiply the value of the last column of text by a number. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.
A.txt
1##4072.0###52.19### # 72## #
2#38705.8# 51.73## # 70# #
372###389.0##51.80##19.77# # 72#
4##59.71#3715.45##71#
With # and space as delimiters, the value of the last column is multiplied by 7, and everything else remains the same.
Under the known condition, the number is random, and the value of the last column is an integer, even if multiplied by 7, it is still within the range that CMD can calculate.
# and spaces and "." The location and number of and the number of columns per row are random.
The output is as follows:
1##4072.0###52.19### # 504## #
2#38705.8# 51.73## # 490# #
372###389.0##51.80##19.77# # 504#
4##59.71#3715.45##497#
Just operate on the values of the last column, and everything else remains the same.
It is required to be universal and efficient.
Ieutk:
The code is as follows:
@ echo off&setlocal enabledelayedexpansion
For / f "usebackq skip=35 delims=" an in ("% ~ dpnx0") do (
Set "var=%%a"
Set "e ="
Set "masks 0"
Set / a num+=1
Call: is "% a"
)
For / l% an in (11% num%) do echo.envelopstr1% astatum% axiomum% axiomatic str2% a!
Pause
Goto: eof
: is
Set "str=%~1"
If "% var:~-1%" lss "0" (
Set "e-mail% varVRV-R-R-M-M-1% e-mail!"
Set "var=%var:~0,-1%" & set / a macaque 1
Goto is
)
Set "_ str2%num%=%e%
Set "_ strn% numm% automotive stranghug 0mm% m%!"
Call: su "! _ strn% num%!"
Goto: eof
: su
Set "a ="
Set "upright% room1"
Set "yellow0"
: st
For / l% an in (019) do if "% ulux color 1%" = "% a" set "a% ulux color 1% a!" & set / a yearly color 1
Set "upright% upland" 0 mai 1%
For / l% an in (0 19) do if "% uvana goto 1%" = "% a" goto: st
Set / a Xerox 1
Set "_ num%x%=%a%"
Set / a _ num%num%*=7
Set "_ str1% x% creative industries strn% x% 01m% y%!"
Goto: eof
1##4072.0###52.19### # 504## #
2#38705.8# 51.73## # 490# #
372###389.0##51.80##19.77# # 504#
4##59.71#3715.45##497#
5##4072.0###52.19### # 72## #
6#38705.8# 51.73## # 70# #
772###389.0##51.80##19.77# # 72#
8##59.71#3715.45##71#
Terse:
The code is as follows:
@ echo off&setlocal enabledelayedexpansion
For / l%% I in (0 19) do set%% iTunes% I
For / f "delims=" I in (1.txt) do set "str=%%i" & call:lp
Pause&goto: eof
: lp
Set/a naughty 1
Set varnished struvous color color% n% penal 1!
If defined! var! (set str2 steps varicose legs str2 steps sets lp=lp) else (
If not defined lp (set str1 examples varicose legs str1!) Else (
Set/a str2*=7&set stranded struts painting painting% n% painting varicose flowers str2percent painting str1!
> b.txt echo! str!
For% I in (str1 str2 n lp) do set% I =
Goto: eof
))
Goto lp
Youxi01:
The code is as follows:
@ echo off 2 > nul 3 > nul
Setlocal enabledelayedexpansion
For / f "delims=" an in (list.txt) do (
Set / a nasty 0
Set var=%%a
Set varicose var. lug =!
For I in (! var!) Do set res=%%i
Rem'/ * handle floating point /
Set / an Oklahoma cities! & & (set / a resurgent courses 7) | | (set varnished resportion.flowers!
For / l% I in (0 1 9) do set varicose varnish% I =% I!
For I in (! var!) Do set/a naughty 1
Set resurfaces, resportions.
Set / a rescheduling 7
Call set resentment%% resportion0lum color%%.% resporpora color color%)
Echo! res!
)
Pause > nul
Huahua0919:
Method 1: (it takes 0.25 to 0.30 seconds)
The code is as follows:
@ echo off&setlocal enabledelayedexpansion
For / f "delims=" I in (LastNumberChange.txt) do set/a n+=1&set LastLine=$%%i$
For / f "delims="% I in (LastNumberChange.txt) do (
Set/a masks 1
If n neq! M! Call set "all inclusive echo%% iConductive echo."
)
: start
Set FirstNumber=%LastLine:~,1%
Set "all1numbers% FirstNumber%"
Set LastLine=%LastLine:~1%
Echo% LastLine% | findstr "[0-9]" > nul&&goto: start
: all1
Set / a tweezers 1
Call set LastOneyed%% all1Rose color color%%
Set/a x=LastOne*1
If "% LastOne%" = = "% x%" goto: all1
Set/a LastOne=%LastOne:~1%*7
Set / a tmurf 1
Set XLMQULTHAULMULTHANGLIMULING all1PULLING LINGRAPHY% t%
Set "Sum=%all%%xlm%%LastOne%%LastLine%"
Echo Sum:$=%
Pause
Method 2: (0.02 to 0.05 seconds)
The code is as follows:
@ echo off&setlocal enabledelayedexpansion
For / f "delims=" I in (LastNumberChange.txt) do set/a n+=1&set LastLine=$%%i$
For / f "delims="% I in (LastNumberChange.txt) do (
Set/a masks 1
If n neq! M! Call set "all inclusive echo%% iConductive echo."
)
: LastOne
Set/a Xerox 1
Call set LastOneering%% LastLineVuzuki Line.com 1%%
Set / a Mult=%LastOne%*1
If not "% Mult%" = = "% LastOne%" goto: LastOne
Set/a Xmuri 1
Call set Front=%%LastLine:~,-%x%%%
Call set Last=%%LastLine:~-%x%%%
: Middle
Set/a x1subscription 1
Call set LastOne1%% FrontGlux%%
Set / a Mult1=%LastOne1%*1
If "% Mult1%" = = "% LastOne1%" goto: Middle
Set/a Middle=%LastOne1:~1%*7
Set/a x1Murray 1
Call set Front=%%Front:~,-%x1%%%
Set "Sum=%all%%Front%%Middle%%Last%"
Echo Sum:$=%
Pause
Batman:
The code is as follows:
@ echo off
For / f "delims="% I in (1.txt) do (
Set "str=%%i" & set "begin=a"
Setlocal enabledelayedexpansion
Call: lp
Echo! str!!a!!var!!last!
Endlocal
)
Pause > nul&goto: eof
: lp
Set "averse% strlux color 1%" & set "str=%str:~,-1%"
If "a" geq "0" (
If "a" leq "9" set "flag=a" & set "begin="
)
If defined flag (
Set varnished% a% reserved varicose set "flag="
) else (
If defined begin (
Set lastworthy% a% last!
) else (
Set / a var*=7&goto: eof
)
)
Goto lp
With the wind:
The code is as follows:
@ echo off&setlocal EnableDelayedExpansion
For / l% an in (0 19) do set.% aversion% a
For / f "delims=" an in (a.txt) do (
Set flag=&set num=&set sun=&set "str=%%a"
Call: loop
)
Pause
: loop
Set "varicose colors strutting colors 1!"
If defined.! var! (set numbing flowers varnished flowers numbing sets flag=a) else (set sunlit flowers varnished inside sunlit sets flag=)
If not defined num set stranded flowers strughuanju mu-lu-lu-mu-bang-ho-ha-ha
If defined flag set stranded flowers strughuanju mu-lu-lu-mu-bang-ho-ha-ha
Set / a num*=7
Echo! stringers, numbs, flowers, sunrigs!
Goto:eof
Thank you for reading! This is the end of the article on "how to use batch processing to multiply the value of the last column of text by a number". I hope the above content can be of some help to you, so that you can learn more knowledge. If you think the article is good, you can share it out for more people to see!
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.