📊CSV Import Templates
iCalendar to CSV Conversion
Converting between iCalendar (.ics) and CSV formats for calendar events.
Explanation
While iCalendar is standard for calendar exchange, CSV is easier for bulk editing.
Examples
Calendar Events CSV
Output
summary,dtstart,dtend,location,description,rrule,uid Weekly Standup,20241220T090000,20241220T093000,Conference Room,"Team sync meeting",FREQ=WEEKLY;BYDAY=MO;UNTIL=20250331,uid-001@example.com All Hands Meeting,20241218T140000,20241218T150000,Main Hall,"Monthly company meeting",FREQ=MONTHLY;BYMONTHDAY=18,uid-002@example.com
Code Examples
JavaScript
// Convert CSV to iCalendar format
function csvToICalendar(csvData) {
const events = parseCSV(csvData);
const icalLines = [
'BEGIN:VCALENDAR',
'VERSION:2.0',
'PRODID:-//My App//EN'
];
events.forEach(event => {
icalLines.push('BEGIN:VEVENT');
icalLines.push(`UID:${event.uid}`);
icalLines.push(`DTSTART:${event.dtstart.replace(/[-:]/g, '')}`);
icalLines.push(`DTEND:${event.dtend.replace(/[-:]/g, '')}`);
icalLines.push(`SUMMARY:${event.summary}`);
if (event.location) {
icalLines.push(`LOCATION:${event.location}`);
}
if (event.description) {
icalLines.push(`DESCRIPTION:${event.description}`);
}
if (event.rrule) {
icalLines.push(`RRULE:${event.rrule}`);
}
icalLines.push('END:VEVENT');
});
icalLines.push('END:VCALENDAR');
return icalLines.join('\r\n');
}Try it Now
💡 Tips
- Use iCalendar format for dates (YYYYMMDDTHHMMSS)
- RRULE for recurring events (RFC 5545)
- UID must be unique per event
- Location and description are optional
- Use VALARM for reminders
- Consider VTIMEZONE for timezone info
⚠️ Common Pitfalls
- iCalendar date format has no separators
- Line folding required at 75 characters
- Special characters need escaping (\, ;)
- CSV is lossy compared to full iCalendar
- All-day events use DATE format (no time)