<commit_before><?php
include("function.php");
include("config.php");

$file=process($_FILES['unorg']);                    //process() method is provided by function.php

array_shift($file);
$rslt_head=array("AMP ID","Project Title","Status","District","City");

$rslt=array();
$rslt[]=$rslt_head;
$finaldata=array();

foreach($file as $dta)
{
    $dta[3]=ltrim($dta[3],' - ');
    $arr=explode(' - ',$dta[3]);
    $len=count($arr);
    foreach($arr as $findta)
    {
        $findta=rtrim($findta,")\n\r");
        $arr2=explode(' (',$findta);
        for($i=0;$i<4;$i++){
            if($i==3)
            {
                if($arr2[0]==null)
                {
                    $finaldata[$i]=' ';
                    $finaldata[++$i]=' ';
                }
                else{
                    $finaldata[$i]=$arr2[0];
                    $finaldata[++$i]=$arr2[1];
                }
            }
            else
            {
                $finaldata[$i]=$dta[$i];
            }
        }
        $rslt[]=$finaldata;
    }
}
var_dump($rslt);

session_start();
$_SESSION["finalout"]=$rslt;
?>

<script>
    window.open('<?php echo BASE_URL?>download.php','_blank');          //BASE_URl is provided by config.php
</script>
<commit_msg>Update process.php<commit_after><?php
include("function.php");
include("config.php");

$file=process($_FILES['unorg']);                    //process() method is provided by function.php

array_shift($file);
$rslt_head=array("AMP ID","Project Title","Status","District","City");

$rslt=array();
$rslt[]=$rslt_head;
$finaldata=array();

foreach($file as $dta)
{
    $dta[3]=ltrim($dta[3],' - ');
    $arr=explode(' - ',$dta[3]);
    $len=count($arr);
    foreach($arr as $findta)
    {
        $findta=rtrim($findta,")\n\r");
        $arr2=explode(' (',$findta);
        for($i=0;$i<4;$i++){
            if($i==3)
            {
                if($arr2[0]==null)
                {
                    $finaldata[$i]=' ';
                    $finaldata[++$i]=' ';
                }
                else{
                    $finaldata[$i]=$arr2[0];
                    $finaldata[++$i]=$arr2[1];
                }
            }
            else
            {
                $finaldata[$i]=$dta[$i];
            }
        }
        $rslt[]=$finaldata;
    }
}
var_dump($rslt);

session_start();
$_SESSION["finalout"]=$rslt;
?>

<script>
    window.location.href="<?php echo BASE_URL?>download.php";         //BASE_URl is provided by 
                                                                            //config.php for redirection to download.php
</script>

{'fraction_non_alphanumeric': 0.20191570881226054, 'fraction_numerical': 0.00996168582375479, 'mean_word_length': 1.716961498439126, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3998306', 'n_tokens_mistral': 898, 'n_tokens_neox': 859, 'n_words': 113}