Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
AlessandroCic
Contributor III
Contributor III

Reading and parsing Google Calendar ics file

Hi forum
In another post I asked about to query Google Calendar item
url=http://www.talendforge.org/forum/viewtopic.php?pid=126354#p126354
I hope that the developer find a way to do this.
Meantime I try another method to read Google Calendar item: in Google there is the possibility to export the calendar in a structured text file with ics extension that it's something like this:
BEGIN:VEVENT
DTSTART:20140107T090000Z
DTEND:20140107T120000Z
DTSTAMP:20140129T164854Z
UID:@google.com
CREATED:20140108T080811Z
DESCRIPTION:Descriprion 1° event
LAST-MODIFIED:20140108T080831Z
LOCATION:
SEQUENCE:1
STATUS:CONFIRMED
SUMMARY:Object 1° event
TRANSP:OPAQUE
END:VEVENT
BEGIN:VEVENT
DTSTART:20131224T073000Z
DTEND:20131224T080000Z
DTSTAMP:20140129T164854Z
UID:@google.com
CREATED:20131223T165249Z
DESCRIPTION:Descriprion 2° event
LAST-MODIFIED:20140107T075355Z
LOCATION:
SEQUENCE:0
STATUS:CONFIRMED
SUMMARY:Object 2° event
TRANSP:OPAQUE
END:VEVENT
.....

It's a sequential file where every event is distinct between the sections
BEGIN:VEVENT

END:VEVENT

Isn?t guaranteed that each section have the same number of rows and the same sequence.
Therefore it would be necessary generate a cycle that it identify the begin and the end of the section to create new DB row.
Then on have to identify the data row by row to assign to a corresponding field.
Is there a Talend component that it running this big job?
Or what components could I use to develop this?
Regards
Alessandro
Labels (2)
12 Replies
Anonymous
Not applicable

Hi Alessandro
The global variable (Integer)globalMap.get("tFileInputFullRow_1_NB_LINE") can to be helpful but in first time I must have the content of the row.
What is the global variable to get the row string? How can I find documentation about this?

Not all of the components documents its global variables right now, we had reported this request to our Doc team, and we will explain the global variable related to the component one by one in future versions of document.
Then if I my row start (es.) with SUMMARY: or DTSTART: I take the value after ":" and I save the value in a structure with a row for each event with the field required.

tFileInputFullRow is the best component to read the entire row one by one from the source file, and then you can use a tFilterRow to tMap to filter rows that starts from SUMMARY: or DTSTART:, then extract the value after ":" on tJavaRow, for example:
output_row.SUMMARY=input_row.line.substring(input_row.line.indexOf(":")+1);

For more details, please see my screenshots. (In this case, I use a tFixedFlowInput to generate the source data provided by you)
Hope this can give you tip!
Shong
0683p000009MCrD.png 0683p000009MCca.png 0683p000009MCrI.png 0683p000009MCrN.png 0683p000009MCrS.png
AlessandroCic
Contributor III
Contributor III
Author

Hi Shong, hi forum
thank you, thank you very very much for this suggestions and the complete example about my issue.
Unfortunately, the example is not adequate to process the file .ics Google because it has a more complex structure than what I initially described.
For example between the lines:
BEGIN:VEVENT

END:VEVENT

it can to be more that one lines that begin with "DESCRIPTION:" and this it destroys the index of the data in the same section of the event.
But this is not a problem, nevertheless the suggestions and the example are very very useful for the development that I'm thinking of doing because I discovered the component tJavaRow which is better than the global variable that I thought to use.
During the next days I will work on tJavaRow and let you know.
Thanks, regards.
Alessandro
Anonymous
Not applicable

Alessandro
Yes, the example job is designed based on the example data you gave, however, I am sure it will give you some hints to achieve your request. If each event may contains more than one "DESCRIPTION:", you can also extract other property such as DTSTAMP that can be an identifier for each event, the identifier will be the key for merging the columns later if needed.
Shong