Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use batch processing to implement a line of content branch output code

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

Editor to share with you how to use batch processing to achieve a line of content branch output code, I believe that most people do not know much about it, so share this article for your reference, I hope you will learn a lot after reading this article. Let's learn about it!

A.txt:

AA1-bB2-cC33dD44eE5fF66gG77hH8iI99

The output is as follows:

Abcdefghi

ABCDEFGHI

123456789

One, two, three, four, five, six, seven, eight.

The only requirement, the veteran skip, left to the novice to do exercises, can not directly echo.

Please find the pattern first.

Otherwise, it is not important to generate temporary files or more than one page of code, just output it correctly.

523066680:

The code is as follows:

@ echo off

Setlocal enabledelayedexpansion

Set axiom 1

For / f "tokens=*" an in ('type 1.x') do set hang=%%a

: a

Set / an aversion 1

Set / a baked% a%

: b

Set hangs% a% hangers% a% hangers% b% pens 1!

Set / a b=%b%+4

If not "! hang:~%b%,1!" = "" goto: B

Echogramme hangs% a%!

If a% leq 2 goto: a

Pause

This train of thought is very direct, there is nothing special, just set up

The first act is 1, 5, 9, 13,. On the position

The second act is 2pm, 6pm, 10pm, 14. On the position

With the wind:

The code is as follows:

@ echo off&setlocal EnableDelayedExpansion

Set "str= aA1-bB2 2cC33dD44eE5fF66gG77hH8iI99"

For / l% an in (0 135) do (

Set / a naughty 1

Call set.! nasty% .roomn% stranded%% aPhone1!

Set / a n=n%%4

)

For / f "tokens=2 delims=="% an in ('set.') Do echo a

Pause > nul

Terse:

The code is as follows:

@ echo off&setlocal EnableDelayedExpansion

Set "str= aA1-bB2 2cC33dD44eE5fF66gG77hH8iI99"

For / l%% I in (013) do for / l% j in (% I 4 35) do set% iBesides% iFoundry% iPreferent struts% jPory 1!

For / l I in (0 1 3) do echo! I!

Pause > nul

Netbenton:

The code is as follows:

@ echo off&setlocal ENABLEDELAYEDEXPANSION

Set "x = AA1-bB2 2cC33dD44eE5fF66gG77hH8iI99"

For / l% an in (0Magne1Magol 3) do ((for / l% b in (% aMagne 4Magne35) do setback packs XGV% bMagne 1!

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.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report