<?php
$dir = 'C:/Users/HP/Downloads/climate-system/climate-system/';
$files = glob($dir . 'viewed_step_*.txt');
foreach ($files as $file) {
    $content = file_get_contents($file);
    if (strpos($content, 'futureLocationTS') !== false || strpos($content, 'futureVariableTS') !== false || strpos($content, 'futureImageTimeSeries') !== false || strpos($content, 'futureImageTS') !== false || strpos($content, 'vTextTS') !== false) {
        echo "Found in " . basename($file) . ":\n";
        // Find matching lines
        $lines = explode("\n", $content);
        foreach ($lines as $lineNum => $line) {
            if (strpos($line, 'futureLocationTS') !== false || strpos($line, 'futureVariableTS') !== false || strpos($line, 'futureImageTimeSeries') !== false || strpos($line, 'futureImageTS') !== false || strpos($line, 'vTextTS') !== false) {
                echo "  Line " . ($lineNum+1) . ": " . trim($line) . "\n";
            }
        }
    }
}
