中国DOS联盟论坛

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-12 11:37
47,811 topics / 349,897 posts / today 0 new / 48,256 members
DOS批处理 & 脚本技术(批处理室) » How to randomly split the strings in the text by lines in BAT
Printable Version  3,361 / 8
Floor1 roubye Posted 2010-12-09 10:51
初级用户 Posts 16 Credits 25 From United States
-------------------------------
1.test
are
yes
god!
no
pre
love/
***
123

-------------------------------
2.text
want
go
do
is

Example 3.text
arewantyesgod!noprelove/***123
areyeswantgod!noprelove/***123
areyesgod!wantnoprelove/***123
areyesgod!nowantprelove/***123
areyesgod!noprewantlove/***123
areyesgod!noprelove/want***123
areyesgod!noprelove/***want123
areyesgod!noprelove/***123want
areyeswantgod!noprelove/***123
arewantyesgod!noprelove/***123
arewantgod!yesnoprelove/***123
arewantgod!noyesprelove/***123
arewantgod!nopreyeslove/***123
arewantgod!noprelove/yes***123
arewantgod!noprelove/***yes123
arewantgod!noprelove/***123yes
....

Randomly combine each line string in 1.text, and at the same time combine with each line of 2.text to form a new line and write to 3.text. Each line in 3.text cannot be repeated

(Please note)
2.text may have tens of thousands of lines
1.text may have tens of thousands of lines
Floor2 Hanyeguxing Posted 2010-12-13 17:01
银牌会员 Posts 897 Credits 1,039 From 在地狱中仰望天堂
Under the MS-DOS system?
Floor3 roubye Posted 2010-12-23 15:52
初级用户 Posts 16 Credits 25 From United States
Floor4 roubye Posted 2010-12-23 15:56
初级用户 Posts 16 Credits 25 From United States
Floor5 roubye Posted 2010-12-24 12:14
初级用户 Posts 16 Credits 25 From United States
Support, friends, help each other, thank you
Floor6 DOSforever Posted 2010-12-24 20:21
金牌会员 Posts 2,239 Credits 4,639
Your requirement for randomness is still unclear.
"Randomly combine each line of strings in 1.text", how many to combine? Also randomly several?
"Combine with each line of 2.text to form a new line", which position of the new line is the string of the combined line of 2.text? Also random?
Floor7 acaigg Posted 2010-12-25 11:49
初级用户 Posts 92 Credits 115
What is this used for?
Floor8 roubye Posted 2011-01-03 14:52
初级用户 Posts 16 Credits 25 From United States
I. "Randomly combine each line of strings in 1.text", how many to combine? Also randomly how many?
If 1.text has m lines, randomly combine m lines
II. The line of strings combined in 2.text
2.text has n lines, extract each line in order, cycle and combine with each new line after random in 1.text in order to generate 2.text
n must be much smaller than m
Floor9 Hanyeguxing Posted 2011-01-03 17:31
银牌会员 Posts 897 Credits 1,039 From 在地狱中仰望天堂
Passing by, I never use pure DOS systems...
[ Contact the Union admin team - 中国DOS联盟 - Standard version ]
Sponsored by ifanr Inc | © 2001–2023