feed-sifter is a lightweight, cross-platform PowerShell script that converts structured XML product feeds into flat CSV files.
It’s ideal for B2B/B2C product data processing, price list extraction, or automated data transformation tasks.
- ✅ Reads XML feeds from a remote URL
- ✅ Extracts nested fields (like
selling_prices) and root fields - ✅ Centralized configuration for feed structure
- ✅ Outputs clean
UTF-8encodedCSV - ✅ Runs on Windows, macOS, and Linux (via
PowerShell Core)
On Windows, PowerShell should be installed by default.
-
Windows
- On Windows: Download from https://github.com/PowerShell/PowerShell
-
PowerShell Core (
pwsh)- On macOS/Linux:
brew install --cask powershell
- On macOS/Linux:
# For a CSV output
.\SiftFeedWHeader.ps1 -xmlUrl "https://example.com/path/to/feed.xml"
# For a XML output
.\SiftFeedXml.ps1 -xmlUrl "https://example.com/path/to/feed.xml"# For a CSV output
pwsh ./SiftFeedWHeader.ps1 -xmlUrl "https://example.com/path/to/feed.xml"
# For a XML output
pwsh ./SiftFeedXml.ps1 -xmlUrl "https://example.com/path/to/feed.xml"| Parameter | Description |
|---|---|
-xmlUrl |
(Required) URL of the remote XML feed you want to process |
Inside the script, you can easily configure the feed structure:
$feedStructure = @{
# XML path to repeating items
rootPath = "//item"
nestedRepeats = @{
# nested arrays
selling_prices = @("currency", "base_price", "discount_price")
}
# root-level fields
flatFields = @("ean", "availability", "availability_count")
}Just modify the flatFields or nestedRepeats arrays to match your XML feed layout.
The resulting output.csv file will be written to the script's current working directory.
It contains headers and all mapped values from the XML feed.
Example output:
ean,availability,availability_count,currency,base_price,discount_price
20000000025,in stock,14,CZK,2500,1999
...- Works with
HTTPSfeeds and requires no authentication. - To change output file name or encoding, modify the
$outputPathandSet-Content/Add-Contentlines. - You can redirect output to a timestamped file for batch jobs.
If you're running the script and see an error like:
File cannot be loaded because running scripts is disabled on this system.
This means PowerShell's execution policy is blocking script execution.
Run this in your current terminal session before executing the script:
Set-ExecutionPolicy -Scope Process -ExecutionPolicy BypassMIT — free to use, modify, and distribute.
Feel free to fork and contribute!
Built with 💙 by BeLenka X Barebarics
Inspired by real-world XML product feed challenges.