Find string in html code

0

I need help with the following:

_Add multiple files (.htm extension), approx 20 files. _Analize and find in the 20 files a string determined in the HTML code (maximum length of the string is 20 characters).

I thought to perform in html with Javascript to accomplish this or prefer another language like C #? Note: My programming knowledge is low. Please help and guidance! Thank you in advance.

    
asked by anonymous 06.03.2018 / 11:46

2 answers

0
C # is a programming language that runs server side much more able to read and write files, has no ability to make changes on the client side, to read files in C # can use the bibiliteca System.IO.File

Javascript is today has a term "variable" as its reality in programming since it was used only as a script that was running on the client side but today it goes beyond that it can read files and create client side files using new technologies such as html5, and there is also its version on the server which is the node.js which is used as the programming language that does basically the same as C #

1. -Agora para seu caso eu ainda usaria C# por poder ler os arquivos
no servidor, e atravez de url

2. - Javascript - lado cliente ainda há umas  limitações e
provavelmente você vai econtar algumas  barreiras para fazer isso

3. - A não ser que você esta usando um servidor node.js e vá fazer a
leitura com a linguagem  Javascript no servidor em  fim

See which of the options will be most practical for you to use.

There is still a possibility to make a dynamic page using C # to read the files and javascript to bring to the client side see as in ajax

    
06.03.2018 / 12:06
0

C # is the fastest way to read all 20 files and generate their output. Example in C #:

StreamReader file = new StreamReader(@"c:\htmls\html1.html");
string line;
line = file.ReadToEnd();
string[] x = line.Split(' ');

foreach (var item in x)
{
   if(item.Length == 20)
   {
   //faca alguma coisa
   }          
}
    
06.03.2018 / 12:50