Skip to main content
DevTools24

محول JSON إلى CSV

تحويل مصفوفات JSON إلى تنسيق CSV لجداول البيانات. الكائنات المتداخلة تُسطح باستخدام تدوين النقطة.

About JSON to CSV Conversion

  • Input should be a JSON array of objects
  • Nested objects are flattened using dot notation (address.city)
  • Arrays are JSON-stringified in the output
  • Values containing delimiters or quotes are properly escaped

JSON to CSV - التفاصيل التقنية

Converting JSON to CSV is useful for exporting API data to spreadsheets, generating reports, or data analysis. Nested objects are flattened using dot notation (e.g., address.city).

بديل سطر الأوامر

# Using jq to convert JSON to CSV\njq -r '(.[0] | keys_unsorted) as $keys | $keys, map([.[ $keys[] ]])[] | @csv' data.json\n\n# Or use json2csv npm package\nnpx json2csv -i data.json