Message Boards Message Boards

0
|
1858 Views
|
2 Replies
|
0 Total Likes
View groups...
Share
Share this post:

Charting multiple data files in one chart

Posted 1 year 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

Hi Steven,

Try this

files = FileNames["*.kml", "C:\\Users\\18136\\OneDrive\\Documents\\Personal Informatics\\Google Timeline"]
Show[Sequence @@ Import /@ files]
POSTED BY: Rohit Namjoshi

Exactly what I was looking for; thank you!

POSTED BY: Steven Buehler
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract