I have an ics file with a lot of events. Want to improve it a bit by adding a LOCATION: tag based on the description part. Any ideas on how to do this? Do I need to do a grep/sed/awk combination or write a python script to edit it? Add a new line with a tag first or do it simultaneously with a moving pattern? Do I need to split the file into parts or just work on one? I thought about every n-line rule, but adding a blank line breaks that rule. The bad example below:
BEGIN:VEVENT
DESCRIPTION:Student plan\n\n Date: 2023.03.10 friday\n\n Time from: 17:30\n\n Time to: 19:00\n\n Hours: 2h00m\n\n Subject: Maths \n\n Room: 124A \n\n Teacher: John Smith \n\n
DTEND:20230310T190000
DTSTAMP:20230227T140621Z
DTSTART:20230310T173000
SEQUENCE:0
SUMMARY:Math
UID:dcea6c77-3c51-4101-a62a-e4949e937fa9
END:VEVENT
As you can see there is a Room: XXX \n\n pattern. It could be moved or copied - doesn't matter.
Exepted:
BEGIN:VEVENT
DESCRIPTION:Student plan\n\n Date: 2023.03.10 friday\n\n Time from: 17:30\n\n Time to: 19:00\n\n Hours: 2h00m\n\n Subject: Maths \n\n Room: 124A \n\n Teacher: John Smith \n\n
LOCATION:Room: 124A
DTEND:20230310T190000
DTSTAMP:20230227T140621Z
DTSTART:20230310T173000
SEQUENCE:0
SUMMARY:Math
UID:dcea6c77-3c51-4101-a62a-e4949e937fa9
END:VEVENT