Quantcast
Channel: Windows PowerShell Forum
Viewing all articles
Browse latest Browse all 2314

Split Dateiname und in eine csv schreiben

$
0
0

Guten Tag,


dieser Script schreibt alle Ordner, Unterordner und die Dateinamnen in eine csv Datei. Funktioniert bestens. Ich benötige noch die Dateiname folgendermassen gesplittet in die CSV Datei zusätzlich:


Beispiel Dateiname: 1.2_3.4.PDF

Soll: ;A a;A1 x;A11 y;1.2;3.4;1.2_3.0.mmap

Ist: ;A a;A1 x;A11 y;1.2_3.0.mmap

Script:

$CurrentPath = Get-Location
$Files = Get-ChildItem -Recurse -File
$FileFullpath = $Files.FullName
$CurrentPath = $CurrentPath -replace '\\', '\\'
foreach ($File in $FileFullpath)
    {
        $Filepath = $File -replace "$CurrentPath", ''
        $Test = $Test + ($Filepath -replace '\\', ';') + "`n"
    }
$Test >> Output.csv

Vielen Dank für eine unterstützung.


Viewing all articles
Browse latest Browse all 2314

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>