ReadLn -notepad

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
carkons
Newbie
Posts: 16
Joined: Wed Jul 27, 2011 12:33 am

ReadLn -notepad

Post by carkons » Thu Jun 27, 2019 10:05 am

Hi,

i have to txt files, url.txt and number.txt

url.txt has website url each line ____________________________________________number.txt has number each line

www.xxx.com/user=1?page= ---------------------------------------------------------------------->33
www.xxx.com/user=2?page= ---------------------------------------------------------------------> 25
www.xxx.com/user=3?page= ---------------------------------------------------------------------->18



i want create new txt file
like this
www.xxx.com/user=1?page=1
www.xxx.com/user=1?page=2
www.xxx.com/user=1?page=3
www.xxx.com/user=1?page=4
..
..
..
www.xxx.com/user=1?page=33
www.xxx.com/user=2?page=1
www.xxx.com/user=2?page=2
www.xxx.com/user=2?page=3
www.xxx.com/user=2?page=4
..
..
..
www.xxx.com/user=2?page=25
www.xxx.com/user=3?page=1
www.xxx.com/user=3?page=2
www.xxx.com/user=3?page=3
www.xxx.com/user=3?page=4
..
..
www.xxx.com/user=3?page=18


i tried but cant :(

User avatar
JRL
Automation Wizard
Posts: 3497
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Re: ReadLn -notepad

Post by JRL » Thu Jun 27, 2019 3:56 pm

Assuming the two files have the same number of lines something like this should work.

Code: Select all

Let>vPath1=C:\Location\Of\URL\Files
Let>vPath2=C:\Location\Of\Number\Files
Let>vNewFile=C:\Name\For\New\Text\File\NewFile.txt

ReadFile>%vPath1%\url.txt,vURL
ReadFile>%vPath2%\url.txt,vNumber

Separate>vURL,crlf,vURLLine
Separate>vNumber,crlf,vNumberLine

Let>uu=0
Repeat>uu
  Add>uu,1
  Let>vPage=vNumberLine_%uu%
  Let>vUser=vURLLine_%uu%
  Let>nn=0
  Repeat>nn
    Add>nn,1
    WriteLn>vNewFile,wres,%vUser%%nn%
  Until>nn=vPage
Until>uu=vURL_Count

carkons
Newbie
Posts: 16
Joined: Wed Jul 27, 2011 12:33 am

Re: ReadLn -notepad

Post by carkons » Thu Jun 27, 2019 7:35 pm

thanks worked well

thank you so much


JRL wrote:
Thu Jun 27, 2019 3:56 pm
Assuming the two files have the same number of lines something like this should work.

Code: Select all

Let>vPath1=C:\Location\Of\URL\Files
Let>vPath2=C:\Location\Of\Number\Files
Let>vNewFile=C:\Name\For\New\Text\File\NewFile.txt

ReadFile>%vPath1%\url.txt,vURL
ReadFile>%vPath2%\url.txt,vNumber

Separate>vURL,crlf,vURLLine
Separate>vNumber,crlf,vNumberLine

Let>uu=0
Repeat>uu
  Add>uu,1
  Let>vPage=vNumberLine_%uu%
  Let>vUser=vURLLine_%uu%
  Let>nn=0
  Repeat>nn
    Add>nn,1
    WriteLn>vNewFile,wres,%vUser%%nn%
  Until>nn=vPage
Until>uu=vURL_Count

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts