China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --

Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!

中国DOS联盟论坛
The time now is 2026-06-25 03:28
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » How to randomly split the strings in the text by lines in BAT View 3,067 Replies 8
Original Poster Posted 2010-12-09 10:51 ·  中国 广东 深圳 电信
初级用户
Credits 25
Posts 16
Joined 2010-12-01 18:47
15-year member
UID 178675
Gender Female
From United States
Status Offline
-------------------------------
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
Floor 2 Posted 2010-12-13 17:01 ·  中国 吉林 延边朝鲜族自治州 延吉市 电信
银牌会员
★★★
正在学习中的菜鸟...
Credits 1,039
Posts 897
Joined 2009-03-01 15:34
17-year member
UID 140302
Gender Male
From 在地狱中仰望天堂
Status Offline
Floor 3 Posted 2010-12-23 15:52 ·  中国 广东 深圳 电信
初级用户
Credits 25
Posts 16
Joined 2010-12-01 18:47
15-year member
UID 178675
Gender Female
From United States
Status Offline
Floor 4 Posted 2010-12-23 15:56 ·  中国 广东 深圳 电信
初级用户
Credits 25
Posts 16
Joined 2010-12-01 18:47
15-year member
UID 178675
Gender Female
From United States
Status Offline
Floor 5 Posted 2010-12-24 12:14 ·  中国 广东 深圳 电信
初级用户
Credits 25
Posts 16
Joined 2010-12-01 18:47
15-year member
UID 178675
Gender Female
From United States
Status Offline
Support, friends, help each other, thank you
Floor 6 Posted 2010-12-24 20:21 ·  中国 上海 杨浦区 电信
金牌会员
★★★★
Credits 4,639
Posts 2,239
Joined 2005-01-30 00:00
21-year member
UID 35785
Gender Male
Status Offline
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?
Floor 7 Posted 2010-12-25 11:49 ·  中国 广东 东莞 中移铁通
初级用户
★★
Credits 115
Posts 92
Joined 2010-12-24 16:57
15-year member
UID 179794
Gender Male
Status Offline
What is this used for?
Floor 8 Posted 2011-01-03 14:52 ·  中国 广东 深圳 电信
初级用户
Credits 25
Posts 16
Joined 2010-12-01 18:47
15-year member
UID 178675
Gender Female
From United States
Status Offline
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
Floor 9 Posted 2011-01-03 17:31 ·  中国 吉林 延边朝鲜族自治州 延吉市 电信
银牌会员
★★★
正在学习中的菜鸟...
Credits 1,039
Posts 897
Joined 2009-03-01 15:34
17-year member
UID 140302
Gender Male
From 在地狱中仰望天堂
Status Offline
Passing by, I never use pure DOS systems...
Forum Jump: