I need some help to get this working the way I wan't.
I am trying to convert the easylist.txt to a specific Json Format and import to my Untangle Firewall.
Bellow is the PHP script that i am running to convert it. The problem is that there is a limit of about 2000 lines during the import. So i need it to create a Export file for each 2000 line. and do as many files as needed.
Any help in this matter would be assume.
Thanks WebFooL
<?php
$Content = "./easylist.txt";
$lines = file($Content);
$vJsonFileName = "AD-Blocker". ".json";
$badcharacters = array("#",'"', "'", "[", "]", "\n", "\t");
header("Content-type: application/json");
header("Content-Disposition: attachment; filename=$vJsonFileName");
header('Cache-Control: public');
echo "[";
foreach($lines as $str){
$cleanstr = str_replace($badcharacters, "", $str);
echo '{"enabled":true,"string":"'.$cleanstr.'","javaClass":"com.untangle.uvm.node.GenericRule"},';
}
echo "]";
?>