婷婷综合国产,91蜜桃婷婷狠狠久久综合9色 ,九九九九九精品,国产综合av

主頁 > 知識(shí)庫 > 批處理實(shí)現(xiàn)文本內(nèi)容居中顯示的代碼

批處理實(shí)現(xiàn)文本內(nèi)容居中顯示的代碼

熱門標(biāo)簽:浙江語音外呼系統(tǒng)招商 用電話機(jī)器人取代人工 aa專業(yè)電話外呼系統(tǒng) 沈陽電銷 無錫極信防封電銷卡價(jià)格 谷歌地圖標(biāo)注錯(cuò)位 外呼獲客系統(tǒng) 四川防封電銷卡套餐 95專業(yè)外呼線路是怎么回事
a.txt  
代碼:

[Promise don't come easy]
I should have known all along.
There was something wrong.
I just never read between the lines.
Then I woke up one day and found you on your way.
Leaving nothing but my heart behind.
What can I do to make it up to you.
Promises don't come easy.
But tell me if there's a way to bring you back home to stay.
Well I'd promises anything to you.
I've been walkin' around with my head hanging down.
Wondrin' what I'm gonna do.
'Cause when you walked out that door.
要求,CMD原始窗口中,不調(diào)節(jié)窗口大小,不生成臨時(shí)文件,居中顯示文本內(nèi)容。輸出如下:
代碼:


[Promise don't come easy]
I should have known all along.
There was something wrong.
I just never read between the lines.
Then I woke up one day and found you on your way.
Leaving nothing but my heart behind.
What can I do to make it up to you.
Promises don't come easy.
But tell me if there's a way to bring you back home to stay.
Well I'd promises anything to you.
I've been walkin' around with my head hanging down.
Wondrin' what I'm gonna do.
'Cause when you walked out that door.

Batcher:

sed -e :a -e "s/^.\{1,77\}$/ /;ta" a.txt

sed.exe
http://xiazai.jb51.net/201010/tools/sed_jb51.rar 

batman:思路說明:
以下代碼是充分findstr命令的示例,使用findstr /n來取得行號(hào)同時(shí)兼容空行,
并將行號(hào)進(jìn)行變量賦值;使用findstr /o來取得第行的字符偏移量,但要通過
上、下行的字符偏移差,因?yàn)樽址浦凳穷愑?jì)遞加的,同時(shí)每行回車增加
兩個(gè)字符偏移,所以不可避免要對最后一行強(qiáng)加回車,在不破壞原文件的情
況下只好生成臨時(shí)文件;利用findstr /o能夠一次性獲得文本所有行的字符偏
移量也就是字符總數(shù),效率和逐字符判斷相比肯定是高得多了。
---------------------------------
復(fù)制代碼 代碼如下:

@echo off
copy /y 1.txt 2.txt>nul
echo.>>2.txtecho end>>2.txt
for /f "tokens=1,2* delims=: " %%i in ('findstr /n /o .* 2.txt') do (
set "_%%i=%%j"set ".%%i=%%k"
  if %%i geq 2 call :lp %%i
)
del /q 2.txtpause>nulgoto :eof
:lp
set /a n=%1-1
set /a num=_%1-_%n%-2
set /a kl=(80-num)/2
for /l %%i in (1,1,%kl%) do set /p= NUL
call,set /p=%%.%n%%%NULECHO.

標(biāo)簽:南平 廣安 煙臺(tái) 青島 連云港 興安盟 常德 迪慶

巨人網(wǎng)絡(luò)通訊聲明:本文標(biāo)題《批處理實(shí)現(xiàn)文本內(nèi)容居中顯示的代碼》,本文關(guān)鍵詞  批處理,實(shí)現(xiàn),文本,內(nèi)容,;如發(fā)現(xiàn)本文內(nèi)容存在版權(quán)問題,煩請?zhí)峁┫嚓P(guān)信息告之我們,我們將及時(shí)溝通與處理。本站內(nèi)容系統(tǒng)采集于網(wǎng)絡(luò),涉及言論、版權(quán)與本站無關(guān)。
  • 相關(guān)文章
  • 下面列出與本文章《批處理實(shí)現(xiàn)文本內(nèi)容居中顯示的代碼》相關(guān)的同類信息!
  • 本頁收集關(guān)于批處理實(shí)現(xiàn)文本內(nèi)容居中顯示的代碼的相關(guān)信息資訊供網(wǎng)民參考!
  • 推薦文章
    主站蜘蛛池模板: 中山市| 图们市| 习水县| 双鸭山市| 东安县| 从化市| 锡林郭勒盟| 富平县| 若羌县| 金溪县| 通山县| 花莲市| 洪江市| 兴文县| 满城县| 江都市| 肥西县| 岗巴县| 永康市| 株洲市| 桓仁| 余干县| 昌江| 景宁| 泗阳县| 常宁市| 崇仁县| 库伦旗| 大新县| 江门市| 阿鲁科尔沁旗| 白城市| 临湘市| 张家川| 阿克陶县| 如东县| 渭源县| 万州区| 苍梧县| 张北县| 嵊州市|