Group Abstract Group Abstract

Message Boards Message Boards

Charting multiple data files in one chart

Posted 2 years ago

Is there a more efficient way to do this, say, by using a wildcard? I tried *.kml and it simply shows each chart separately; I would like to plot them all in one map.

Show[Import[
  "C:\\Users\\18136\\OneDrive\\Documents\\Personal \
Informatics\\Google Timeline\\history-2022-12-31.kml"],
 Import["C:\\Users\\18136\\OneDrive\\Documents\\Personal \
Informatics\\Google Timeline\\history-2023-01-01.kml"], 
 Import["C:\\Users\\18136\\OneDrive\\Documents\\Personal \
Informatics\\Google Timeline\\history-2023-01-02.kml"],
 Import["C:\\Users\\18136\\OneDrive\\Documents\\Personal \
Informatics\\Google Timeline\\history-2023-01-03.kml"], 
 Import["C:\\Users\\18136\\OneDrive\\Documents\\Personal \
Informatics\\Google Timeline\\history-2023-01-04.kml"], 
 Import["C:\\Users\\18136\\OneDrive\\Documents\\Personal \
Informatics\\Google Timeline\\history-2023-01-05.kml"], 
 Import["C:\\Users\\18136\\OneDrive\\Documents\\Personal \
Informatics\\Google Timeline\\history-2023-01-06.kml"], 
 Import["C:\\Users\\18136\\OneDrive\\Documents\\Personal \
Informatics\\Google Timeline\\history-2023-01-07.kml"], 
 Import["C:\\Users\\18136\\OneDrive\\Documents\\Personal \
Informatics\\Google Timeline\\history-2023-01-08.kml"], 
 Import["C:\\Users\\18136\\OneDrive\\Documents\\Personal \
Informatics\\Google Timeline\\history-2023-01-09.kml"], 
 Import["C:\\Users\\18136\\OneDrive\\Documents\\Personal \
Informatics\\Google Timeline\\history-2023-01-10.kml"], 
 Import["C:\\Users\\18136\\OneDrive\\Documents\\Personal \
Informatics\\Google Timeline\\history-2023-01-11.kml"], 
 Import["C:\\Users\\18136\\OneDrive\\Documents\\Personal \
Informatics\\Google Timeline\\history-2023-01-12.kml"]
 ]
POSTED BY: Steven Buehler
2 Replies
Posted 2 years ago

Exactly what I was looking for; thank you!

POSTED BY: Steven Buehler
Posted 2 years ago

Hi Steven,

Try this

files = FileNames["*.kml", "C:\\Users\\18136\\OneDrive\\Documents\\Personal Informatics\\Google Timeline"]
Show[Sequence @@ Import /@ files]
POSTED BY: Rohit Namjoshi
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard