Easiest scripting method to merge two text files - Ruby, Python, JavaScript, Java?

前端 未结 6 768
一个人的身影
一个人的身影 2021-01-14 21:14

I have two text files, one containing HTML and the other containing URL slugs:

FILE 1 (HTML):

  • 6条回答
    •  感情败类
      2021-01-14 22:12

      PHP is the easiest!

      $firstFile = file('file1.txt');
      $secodFile = file('file2.txt');
      
      $findKey='/article/';
      $output='';
      
      if (count($firstFile)==count($secodFile)) 
                          or die('record counts dont match');
      
      for($i=0;$i

    提交回复
    热议问题