《做自己》+《爱生活》收到了,感谢七哥

      要说我是厚着脸皮跻身互联网吧,这一点也不夸张,自己本身圈子很小,更是没有技术,却还整天谈论着互联网风云,你说这算装逼吗?

今天头一次在csdn写感悟博,实在不知如何下手,平时不喜于表达心扉,却还是写出了 感谢七哥。大伙都喊他鬼脚七,我还是习惯叫七哥,这根近乎扯不上什么关系,总觉得吧,他就是我的大哥一样,在书里。下单,支付,3天,书收到了,我给大伙晒晒封面

做自己 爱生活

七哥亲笔签名 哇哈哈

   我实在不知道写啥,原因是书才收到,还没仔细阅读,在写的话就扯到其他啦,总之,还是感谢七哥,希望能与你见上一面,握个手,和张影,足矣...

以下是批处理代码实现: ```batch @echo off setlocal enabledelayedexpansion REM Step 1: Drag and drop the txt file onto the cmd window to set the file path set "filepath=%~1" REM Step 2: Read the txt file and split into elements by comma set /a linecount=0 for /f "tokens=1-4 delims=," %%a in (%filepath%) do ( set /a linecount+=1 set "line[!linecount!]=%%a,%%b,%%c,%%d" ) REM Step 3: Get the line count of the txt file set /a Txt_lines=%linecount%-1 REM Step 4: Get the length of the first element in the last line set "lastline=!line[%linecount%]!" set /a Txt_lines_length=0 for /f "tokens=1 delims=," %%a in ("!lastline!") do ( set "lastelement=%%a" for /l %%i in (0,1,100) do ( if not "!lastelement:~%%i,1!"=="" set /a Txt_lines_length=%%i+1 ) ) REM Step 5: Add "0" to the end of the first element in each line for /l %%i in (1,1,!linecount!) do ( set "line[%%i]=!line[%%i]:~0,%Txt_lines_length%!000!line[%%i]:~%Txt_lines_length%!" ) REM Step 6: Set the second element of each line to "1" for /l %%i in (1,1,!linecount!) do ( for /f "tokens=2 delims=," %%a in ("!line[%%i]!") do ( set "line[%%i]=!line[%%i]:%%a,=1,!" ) ) REM Step 7: Add "3" to the beginning of the third element in each line for /l %%i in (1,1,!linecount!) do ( for /f "tokens=1,2,* delims=," %%a in ("!line[%%i]!") do ( set "line[%%i]=%%a,%%b,3%%c" ) ) REM Step 8: Add "83" to the beginning of the fourth element in each line for /l %%i in (1,1,!linecount!) do ( for /f "tokens=1,2,3,* delims=," %%a in ("!line[%%i]!") do ( set "line[%%i]=%%a,%%b,%%c,83%%d" ) ) REM Step 9: Input a number with decimal point and set it to the variable mj set /p mj="Please input a number with decimal point: " REM Step 10: Add new content to the beginning of the txt file echo [描述] 大哥=北京1986年 二哥=3 三哥=上海 四哥=龙 五哥=25 六哥=0.001 七哥=,,,,,, [啥玩意] Txt_lines,mj,哥哥1,妹,,,,@ > newfile.txt type %filepath% >> newfile.txt REM Step 11: Generate the modified txt file move /y newfile.txt %filepath% echo The txt file has been modified successfully! ``` 请将以上代码保存为 `modify_txt.bat` 文件,然后将需要修改的txt文件拖拽至该文件上即可执行。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值