Thanks to visit codestin.com
Credit goes to github.com

Skip to content

randomaccess3/parse_tasks

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

3 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ“„ XML to JSON Task Parser

This PowerShell script recursively scans a folder for XML files, converts each file into a structured JSON format, and saves the results to a specified output file. It also captures useful metadata such as file path, creation time, and last modification time.

πŸš€ Features

  • πŸ” Recursively parses XML files in a given directory
  • πŸ”„ Converts XML content into nested JSON structures
  • πŸ•’ Captures file metadata (path, creation time, modification time)
  • πŸ’Ύ Outputs a single compressed JSON file
  • πŸ› οΈ Gracefully handles malformed XML files

🧰 Usage

.\parse_tasks.ps1 -inputFolder "C:\path\to\xml\files" -outputFile "C:\path\to\output.json"

Parameters

Parameter Description
-inputFolder Path to the folder containing XML files
-outputFile Path to the resulting JSON output file

🧠 How It Works

  1. Recursively scans the input folder for .xml files.
  2. Parses each XML file into a dictionary-like structure.
  3. Extracts metadata: file path, creation time (UTC), and last modified time (UTC).
  4. Serializes the results into a compressed JSON format.
  5. Saves the final output to the specified file.

πŸ“¦ Output Format

Each entry in the output JSON file includes:

{
  "Path": "C:\\path\\to\\file.xml",
  "Created": "2025-07-07T06:12:34.0000000Z",
  "Modified": "2025-07-07T06:15:00.0000000Z",
  "Task": {
    "RootElement": {
      "ChildElement": "Value",
      "Attributes": "..."
    }
  }
}

⚠️ Error Handling

  • Files that fail XML parsing are skipped with a warning.
  • The script continues processing remaining files without interruption.

πŸ“„ License

This project is licensed under the MIT License.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published