Get the App
SLTechnology News&Howtos  ›  Development  › 

How to use batch processing to realize horizontal column to vertical column of text content

Shulou Source: shulou.com Published: 2022-06-03 08:37:43 09月16日 Update

This article mainly shows you "how to use batch processing to achieve the horizontal column of text content", the content is easy to understand, clear, hope to help you solve your doubts, the following let the editor lead you to study and learn "how to use batch processing to achieve text content horizontal column into column" this article.

Because the forum will swallow the first space of each line of the text, come up with a screenshot.

Each line has the same number of characters, but I don't know how many characters.

Notice that the third line of the text is followed by a space. There is a space after the fourth line x.

The output is:

That is, the horizontal column changes to the vertical column, and the original space is retained.

Required, efficient, do not generate temporary files.

Batman:

The code is as follows:

@ echo off

For / f "delims="%. In (1.txt) do set "_ = 0" & set ".. =%." & call: {}

For / l%% + in (1JI% mom%) do call,echo.%%..%%+%%

Pause > nul&goto: eof

: {}

Set "# =%..: ~, 1%" & call,set ".. =%..: ~ 1%%" & set / a _ + = 1 percent callcallset "..% _% =%..% #%" & if defined.. Goto {}

Explain below:

The reason why I wrote such a weird piece of code is to tell you that as long as you use it properly, batches can really be written at will.

It's the fun part.

Shallow silence:

The code is as follows:

@ echo off&setlocal enabledelayedexpansion

For / l% an in (0meme 1mem10) do (

For / f "delims="% I in (a.txt) do (

Set ke=%%i

Set / pawns / kepurs%% aPhone1!

Tags: Content text code spaces articles characters learning help appropriate weird freewheeling fun that is screenshot location desired file easy to understand Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Technology vpn macOS NVidia MySQL