CSV से YAML कन्वर्टर
Example
Input:
name,age Ali,30 Sara,25
Output:
- name: Ali age: 30 - name: Sara age: 25
इस converter के बारे में
CSV-to-YAML spreadsheet-आकार के डेटा और config-आकार के डेटा के बीच का पुल है: static sites के लिए seed files, tests के लिए fixture data, apps के लिए lookup tables। Converter CSV को ठीक से parse करता है (quoted fields, embedded commas और newlines, doubled quotes), header row को keys के रूप में उपयोग करता है, और values को वैसे type करता है जैसे YAML reader चाहेगा — साफ़ integers और decimals संख्याएँ बन जाते हैं; बाकी सब string रहता है और सिर्फ़ तभी quoted होता है जब YAML syntax माँगे। Ragged rows (headers से कम cells) values को ग़लत columns में खिसकाने के बजाय nulls बनाती हैं — naive converters में सबसे आम silent corruption।
अक्सर पूछे जाने वाले सवाल
अगर किसी row में header से कम columns हों तो क्या होगा?
Missing cells अपनी जगह खाली values बन जाती हैं — values कभी पड़ोसी column में नहीं खिसकतीं।
क्या यह commas वाले quoted CSV fields संभालेगा?
हाँ — parser standard quoting rules (RFC 4180 style) implement करता है, quoted fields के अंदर newlines समेत।