How i can generate many html files

Discuss RoboTask here
Post Reply
sara00
Posts: 3
Joined: Sat Nov 13, 2021 2:24 am

How i can generate many html files

Post by sara00 »

hello

i have html code in text file like that

<html>
<head>
<title>hello</title>
</head>
<body>
<p>hello world</p>
</body>
</html>


i want generate many html files with random title , content and file names
Oleg
Site Admin
Posts: 3004
Joined: Thu Jan 01, 1970 1:00 am
Contact:

Re: How i can generate many html files

Post by Oleg »

There is system function RandomString(<num>). But it returns the array of symbols, not words or phrases.
I think that you want to use some meaningful text (not an array of random symbols)
In this case you must have the prepared array of words, phrases or texts in some database. Next you can get random item from this database by it's ID.
This is not very simple job
Oleg Yershov
sara00
Posts: 3
Joined: Sat Nov 13, 2021 2:24 am

Re: How i can generate many html files

Post by sara00 »

Oleg wrote: Sun Dec 19, 2021 9:56 am There is system function RandomString(<num>). But it returns the array of symbols, not words or phrases.
I think that you want to use some meaningful text (not an array of random symbols)
In this case you must have the prepared array of words, phrases or texts in some database. Next you can get random item from this database by it's ID.
This is not very simple job
yes i created variables ..


<html>
<head>
<title>{title({RandomValue(10)})}</title>
</head>
<body>
<p>{content({RandomValue(20)})}</p>
</body>
</html>



but i want know how can put this code in files and save it with name from title variables

i hope you help me
thanks
Lana_K
Posts: 24
Joined: Tue Jul 14, 2020 7:43 pm
Location: Bristol, UK

Re: How i can generate many html files

Post by Lana_K »

In similar situation I created a number of XML, and even PDF, files using 'Write Text File' but named them with correct extension. I think it can work for HTML files as well.
Oleg
Site Admin
Posts: 3004
Joined: Thu Jan 01, 1970 1:00 am
Contact:

Re: How i can generate many html files

Post by Oleg »

Also look at the variable UniqueFileName({TempDir}\*.tmp)
Put the folder and file mask as parameter.

For example: {UniqueFileName(c:\incoming\*.html)}
It returns unique file name in this folder.
Oleg Yershov
Post Reply