reference plugin and image gen analysis
This commit is contained in:
24
igny8-ai-seo-wp-plugin/extract_docx.ps1
Normal file
24
igny8-ai-seo-wp-plugin/extract_docx.ps1
Normal file
@@ -0,0 +1,24 @@
|
||||
Add-Type -AssemblyName System.IO.Compression.FileSystem
|
||||
|
||||
$docxPath = "e:\GitHub\igny8-ai-seo\docs\Igny8 WP Plugin to Igny8 App Migration Plan.docx"
|
||||
$zip = [System.IO.Compression.ZipFile]::OpenRead($docxPath)
|
||||
|
||||
$entry = $zip.Entries | Where-Object { $_.FullName -eq "word/document.xml" }
|
||||
if ($entry) {
|
||||
$stream = $entry.Open()
|
||||
$reader = New-Object System.IO.StreamReader($stream)
|
||||
$xml = $reader.ReadToEnd()
|
||||
$reader.Close()
|
||||
$stream.Close()
|
||||
|
||||
# Extract text from XML (simple approach)
|
||||
$xml = $xml -replace '<[^>]+>', "`n"
|
||||
$xml = $xml -replace '\s+', " "
|
||||
$xml = $xml -replace '\n\s*\n', "`n"
|
||||
|
||||
Write-Output $xml.Trim()
|
||||
}
|
||||
|
||||
$zip.Dispose()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user