How to get product sku or details using product name CSV in magento

If you Have Product Name and get product details for import product csv use this. Create php file and put code

<?php
require_once '../app/Mage.php';
Mage::app();
$row = 1;
echo '<table>';
if (($handle = fopen("Yourcsvname.csv", "r")) !== FALSE) {
    while (($data = fgetcsv($handle, 1000, ",")) !== FALSE) {
        $num = count($data);
        //echo "<p> $num fields in line $row: <br /></p>\n";
        $row++;
 
        for ($c=0; $c < $num; $c++) {
            echo '<tr>';
                                                echo '<td>'.$data[$c]. "</td>";
                                                $product_collection = Mage::getResourceModel('catalog/product_collection')
                      ->addAttributeToSelect('*')
                      ->addAttributeToFilter('name',$data[$c])
                      ->load();
                                                foreach ($product_collection as $product) {
                                                                echo '<td>'.$product->getSku() . "</td>";
 
                                                                //exit;
                                                               
                                                }
                                                echo '</tr>';
        }
    }
    fclose($handle);
}
echo '</table>';
 
?>
 
 

  After this same location put your CSV File. In csv File your product Name must be compulsory and save this. You Get your csv product all Details.