Page 1 of 1

How i can generate many html files

Posted: Tue Dec 14, 2021 1:58 am
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

Re: How i can generate many html files

Posted: Sun Dec 19, 2021 9:56 am
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

Re: How i can generate many html files

Posted: Wed Dec 22, 2021 4:52 pm
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

Re: How i can generate many html files

Posted: Wed Feb 16, 2022 12:13 am
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.

Re: How i can generate many html files

Posted: Wed Feb 16, 2022 8:06 am
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.