![]() |
China DOS Union-- Unite DOS · Advance DOS · Grow DOS --Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum |
| Guest | Log in | Register | Members | Search | China DOS Union |
|
中国DOS联盟论坛 The time now is 2026-08-29 08:05 |
47,816 topics / 349,916 posts / today 0 new / 48,265 members |
| DOS批处理 & 脚本技术(批处理室) » [Closed] Batch script to read text line by line, please help experts to improve |
| Printable Version 14,831 / 31 |
| Floor1 ccwan | Posted 2006-11-19 21:44 |
| 金牌会员 Posts 1,160 Credits 2,725 From 河北廊坊 | |
|
─────────── Moderator Reminder ───────────
The code written by user namejm on floor 21 is a perfect solution ─────────── Moderator Reminder ─────────── I made a batch script that reads the content of a text file and displays it line by line and character by character, but I'm too inexperienced to make it display exactly according to the original text format. Please help, experts. Thank you! [ Last edited by bjsh on 2007-8-10 at 08:35 AM ] |
|
| Floor2 ccwan | Posted 2006-11-19 22:57 |
| 金牌会员 Posts 1,160 Credits 2,725 From 河北廊坊 | |
|
Bumping my own thread!
|
|
| Floor3 redtek | Posted 2006-11-19 23:23 |
| 金牌会员 Posts 1,147 Credits 2,902 | |
|
Each time, read one line, but you don't have the code that makes it start a new line after displaying a line~ : )
So it's all displayed continuously~ : ) That is to say, you read the content of a line of text, Then decompose this variable so as to display each character on the screen one by one (the white background is very beautiful~ : )), But how do you know when the line you took has been displayed? (Knowing when the line is displayed is to be able to type a new line character again). So, should we actively add a "marking end" symbol at the end of this variable after taking a line to facilitate judgment? If there is an if judgment to see if this line has reached the end, if yes, type a new line character echo. This method has an example on the 8th floor of the following post~ : ) See in detail: A brief analysis of the helpless signature code http://www.cn-dos.net/forum/viewthread.php?tid=18838&fpage=1 The examples from reading text content to displaying special symbols in the above post are already very comprehensive~ : ) [ Last edited by redtek on 2006-11-19 at 10:27 AM ] |
|
| Floor4 ccwan | Posted 2006-11-19 23:26 |
| 金牌会员 Posts 1,160 Credits 2,725 From 河北廊坊 | |
|
Thanks! It's precisely after reading that I had this idea and tried to play around. Mainly because I haven't fully digested and absorbed it yet.
[ Last edited by ccwan on 2006-11-19 at 11:36 PM ] |
|
| Floor5 vkill | Posted 2006-11-20 07:03 |
| 金牌会员 Posts 1,744 Credits 4,103 From 甘肃.临泽 | |
|
Hehe~ I like to first use sed -n 1p to read the line and then read the characters one by one
|
|
| Floor6 lxmxn | Posted 2006-11-20 07:53 |
| 版主 Posts 4,938 Credits 11,386 | |
|
Just wrote it this afternoon. Because it doesn't support reading special characters, I didn't dare to post it. Seeing the brother post this thread, I just post it now. Please forgive me, all experts. Drag and drop the file to be read onto the ReadTxt.BAT file to release it. |
|
| Floor7 chainliq | Posted 2006-11-20 08:07 |
| 高级用户 Posts 244 Credits 635 From 广西贵港 | |
|
Hehe, I actually find this quite interesting. May I ask how to fix its display speed?
|
|
| Floor8 vkill | Posted 2006-11-20 08:09 |
| 金牌会员 Posts 1,744 Credits 4,103 From 甘肃.临泽 | |
|
To echo, so special characters are not easy to handle
|
|
| Floor9 redtek | Posted 2006-11-20 10:06 |
| 金牌会员 Posts 1,147 Credits 2,902 | |
|
Top~~Brother lxmxn's animation reading is wonderful, you can read novels啦~ : )
|
|
| Floor10 ccwan | Posted 2006-11-20 21:01 |
| 金牌会员 Posts 1,160 Credits 2,725 From 河北廊坊 | |
|
Brother lxmxn is really amazing! Admire and thank you.
This is exactly the effect I wanted, thank you brother for the code! Let's see if we can solve the special character problem. [ Last edited by ccwan on 2006-11-21 at 12:30 AM ] |
|
| Floor11 hxuan999 | Posted 2006-11-23 07:49 |
| 中级用户 Posts 161 Credits 337 | |
|
Reading novels? That's really a good idea. Just wonder if any expert can make an electronic reader with batch processing.
|
|
| Floor12 redtek | Posted 2006-11-23 08:46 |
| 金牌会员 Posts 1,147 Credits 2,902 | |
|
How cool it is to read e-books on a PSP game console~ :)
[ Last edited by redtek on 2006-11-22 at 10:31 PM ] |
|
| Floor13 scriptor | Posted 2007-01-12 12:38 |
| 银牌会员 Posts 555 Credits 1,187 | |
|
What a good thing!
It has solved one of my problems. Thank you. |
|
| Floor14 stormback | Posted 2007-01-19 05:08 |
| 新手上路 Posts 3 Credits 1 | |
|
Good stuff
|
|
| Floor15 liuxin31554155 | Posted 2007-01-19 05:47 |
| 新手上路 Posts 7 Credits 14 | |
|
Pretty good stuff~
|
|
| 1 2 3 Next |
|
[ Contact the Union admin team -
中国DOS联盟 -
Standard version ] Sponsored by ifanr Inc | © 2001–2023 |