Batch processing achieves branch output of one line of content

Source: Internet
Author: User

A.txt:
 
Code:
AA1 bB2 two cC3 three dD4 four eE5 five fF6 six gG7 seven hH8 eight iI9 nine
The output is as follows:
 
Code:
Abcdefghi
ABCDEFGHI
123456789
September 1234
The only requirement is that the veteran skipped it and left it for the novice to do exercises. The echo is not allowed directly.
Find the rule first.
Otherwise, it is not important to generate a temporary file or code more than one page. Correct output is enough.
 
523066680: Copy codeThe Code is as follows: @ echo off
Setlocal enabledelayedexpansion
Set a =-1
For/f "tokens = *" % a in ('Type 1. x') do set hang = %
:
Set/a + = 1
Set/a B = % a %
: B
Set hang % a % =! Hang % a % !! Hang :~ % B %, 1!
Set/a B = % B % + 4
If not "! Hang :~ % B %, 1! "=" "Goto: B
Echo ,! Hang % a %!
If % a % leq 2 goto:
Pause

This idea is very direct, nothing special, that is, setting up
First Act 1, 5, 9, 13 ,...... Bit
Second act ...... Bit
 
 
WIND:Copy codeThe Code is as follows: @ echo off & setlocal EnableDelayedExpansion
Set "str = aA1 one bB2 two cC3 three dD4 four eE5 five fF6 six gG7 seven hH8 eight iI9 nine"
For/l % a in (0 1 35) do (
Set/a n + = 1
Call set .! N! = % .! N! %! Str :~ % A, 1!
Set/a n = n % 4
)
For/f "tokens = 2 delims =" % a in ('set. ') do echo %
Pause> nul

 
Terse:Copy codeThe Code is as follows: @ echo off & setlocal EnableDelayedExpansion
Set "str = aA1 one bB2 two cC3 three dD4 four eE5 five fF6 six gG7 seven hH8 eight iI9 nine"
For/l % I in (0 1 3) do for/l % j in (% I 4 35) do set % I =! % I !! Str :~ % J, 1!
For/l % I in (0 1 3) do echo! % I!
Pause> nul

 
Netbenton:Copy codeThe Code is as follows: @ echo off & setlocal ENABLEDELAYEDEXPANSION
Set "x = aA1 one bB2 two cC3 three dD4 four eE5 five fF6 six gG7 seven hH8 eight iI9 nine"
For/l % a in (0, 1, 3) do (for/l % B in (% a, 4, 35) do set/p =! X :~ % B, 1! <Nul) & echo .)
Pause

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.