# CSV Datei vor Import ändern

**URL:** <https://forum.shopware.com/t/csv-datei-vor-import-andern/65850>\
**Category:** Programmierung\
**Created:** [29. März 2020 um 23:08 UTC](https://forum.shopware.com/t/csv-datei-vor-import-andern/65850 "2020-03-29T23:08:53Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![eesty](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/eesty/32/15169_2.png) [@eesty](https://forum.shopware.com/u/eesty)\
**Post date:** [29. März 2020 um 23:08 UTC](https://forum.shopware.com/t/csv-datei-vor-import-andern/65850/1 "2020-03-29T23:08:53Z")

</div>

Hallo ShopWare Community,&nbsp;

&nbsp;

**ich möchte folgendes noch erreichen:**

 ![](https://europe1.discourse-cdn.com/flex013/uploads/shopware/original/1X/5cdcc969e16ad7d9bd7b5103fc893cff1233d301.jpeg)

&nbsp;

bis hier hin der code:&nbsp;

&nbsp;

```
 $value) {
                if (strpos($value, 'Imprints/PrintOption/') === 0 && strpos($value, 'ImprintName') !== false) {
                    $positions[] = $key;
                }
            }
   
            $first = array_shift($positions);
            $row++;
            continue;
        }

        $data[$size] = '1';
        $data[$size + 1] = 'Werbeanbringung:ohne';
		
        fputcsv($nfp, $data);
        
        foreach ($positions as $key => $col) {
           
				$data[0] = $data[1] . '.' . $key;
            	$data[$size] = '2';
            	$data[$size + 1] = 'Werbeanbringung:'.$data[$col];
			
            	fputcsv($nfp, $data);
        }
        $row++;
    }

    fclose($handle);
    unset($handle);

    fclose($nfp);
    unset($nfp);
}

file_put_contents('AAAAAAA.csv', file_get_contents($newSrcFilename));

$itemCount = $driver->getItemCount($newSrcFilename, $config);
$_SESSION['runConfig'][$guid]["filePath"] = $newSrcFilename;
$_SESSION["runConfig"][$guid]["progressMessage"] = "Importing 0/" . $itemCount;
$_SESSION["runConfig"][$guid]["items"] = $itemCount;

```

Würde mich sehr freuen wenn sich jemand damit auskennt, ich komm nicht mehr weiter …
