新闻

新闻动态

良好的口碑是企业发展的动力

@echo off

发布时间:2024-02-21 08:56:41 点击量:236
漳州网站建设

 

@echo off

 

This script will generate a text file with 1000 words. In order to do this

we will use a loop that will iterate 1000 times and write a random word to the file each time.

 

Here is the code:

 

```batch

@echo off

 

setlocal EnableDelayedExpansion

 

set words=apple banana cherry dog elephant frog grape honeydew iguana jackal kangaroo lion monkey

 

set /a count=0

 

for /l %%i in (1

1

1000) do (

set /a index=!random! %% 10

for /f "tokens=1

2 delims= " %%a in ('echo !words!') do (

if !index! equ 0 echo %%a >> output.txt

set /a index=!index!-1

)

)

 

endlocal

```

 

Save this code as a .bat file and run it in Command Prompt. It will generate a file called output.txt with 1000 randomly selected words from the list provided. Feel free to modify the list of words if you want different words to be included in the output file.

免责声明:本文内容由互联网用户自发贡献自行上传,本网站不拥有所有权,也不承认相关法律责任。如果您发现本社区中有涉嫌抄袭的内容,请发送邮件至:dm@cn86.cn进行举报,并提供相关证据,一经查实,本站将立刻删除涉嫌侵权内容。本站原创内容未经允许不得转载。
上一篇: git分支管理
下一篇: typescriptconst