求教:如何显示一个文本内的随机行? 请DX赐教~~
ps:本人刚开始学习p处理,以后还请DX们多多指教T_T
ps:本人刚开始学习p处理,以后还请DX们多多指教T_T
联盟域名:www.cn-dos.net 论坛域名:www.cn-dos.net/forum
DOS,代表着自由开放与发展,我们努力起来,学习FreeDOS和Linux的自由开放与GNU精神,共同创造和发展美好的自由与GNU GPL世界吧!
@ECHO %DBG% OFF
SETLOCAL ENABLEDELAYEDEXPANSION
FOR /F "TOKENS=*" %%i IN (TEST.TXT) DO (SET /A h+=1 & SET r!h!=%%i)
SET /A s=%RANDOM%%%%h%+1
ECHO !r%s%!
| 评分人 | 分数 | 时间 |
|---|---|---|
| theoldman | +1 | 2007-02-03 05:48 |
| 评分人 | 分数 | 时间 |
|---|---|---|
| theoldman | +1 | 2007-02-03 05:49 |
@echo off
:: 为了能显示特殊字符,echo语句加上了引号
for /f "tokens=1 delims=:" %%i in ('findstr /n .* test.txt') do set lines=%%i
set /a rnd=%random%%%%lines%
for /f "delims= eol=" %%i in ('more +%rnd% test.txt') do echo "%%i"&pause&exit
fd saf dsa f
fds afd saf
fd s afs
fdsaf dsaf
fdsa fdsalkjf
fd saf dsafb
ewq sdfgfgga
最美的十大精典爱情句子
1) I love you not because of who you are, but because of who I am when I am with you.
我爱你,不是因为你是一个怎样的人,而是因为我喜欢与你在一起时的感觉。
2) No man or woman is worth your tears, and the one who is, won't make you cry.
没有人值得你流泪,值得让你这么做的人不会让你哭泣。
3) The worst way to miss someone is to be sitting right beside them knowing you can't have them.
失去某人,最糟糕的莫过于,他近在身旁,却犹如远在天边。
4) Never frown, even when you are sad, because you never know who is falling in love with your smile.
纵然伤心,也不要愁眉不展,因为你不知是谁会爱上你的笑容。
5) To the world you may be one person, but to one person you may be the world.
对于世界而言,你是一个人;但是对于某个人,你是他的整个世界。
6) Don‘t waste your time on a man/woman, who isn't willing to waste their time on you.
不要为那些不愿在你身上花费时间的人而浪费你的时间。
7) Just because someone doesn't love you the way you want them to, doesn't mean they don't love you with all they have.
爱你的人如果没有按你所希望的方式来爱你,那并不代表他们没有全心全意地爱你。
8) Don't try so hard, the best things come when you least expect them to.
不要着急,最好的总会在最不经意的时候出现。
9) Maybe God wants us to meet a few wrong people before meeting the right one, so that when we finally meet the person, we will know how to be grateful.
在遇到梦中人之前,上天也许会安排我们先遇到别的人;在我们终于遇见心仪的人时,便应当心存感激。
10) Don't cry because it is over, smile because it happened.
不要因为结束而哭泣,微笑吧,为你的曾经拥有。