Add a method to this php script for removing entries from a .csv file based on number values in a given. <>= and the word result in the final column. - Null, yes, no
[login to view URL]
example list
[login to view URL]
<?php
error_reporting(E_ERROR);
set_time_limit(120); // Time limit - 10 minutes
if($_POST['submit'])
{
# Get file contents
$filename = $_FILES['file']['tmp_name'];
$filter_words = implode("|", split(",", trim(trim(trim($_POST['filter']), ",")) ) );
if (($handle = fopen( $filename , "r")) !== FALSE) {
while (($data = fgetcsv($handle, 1000, ",")) !== FALSE) {
$row++;
$col1 = $data[0];
if(preg_match('@\b('.$filter_words.')+\b@i', $col1))
continue;
echo implode(",", $data) . "<br/>";
}
fclose($handle);
}
// Delete temporary uploaded file
@unlink($filename);
exit;
}
?>
<form method="POST" enctype="multipart/form-data">
CSV File: <input type="file" name="file"><br>
Filter words: (separate multiple words by comma)<input type="text" name="filter" value="for,sheet,"/><br/>
<input type="submit" name="submit" >
</form>