help merging many gps .log files into 1 .log file

Joined
May 2, 2005
Messages
173
Reaction score
0
Points
16
Hello,
I recently started photographing with my Canon 6D and traveled around Central America. I loved the function of the gps logger which provides .log files of the whole trip....but I have many individual .log files and I would like to make 1 .log file of the whole 2 month trip. Is there any way to do this?
Thanks for the help...
Micah
 

Raz0rEdge

Well-known member
Staff member
Moderator
Joined
Jul 17, 2009
Messages
15,745
Reaction score
2,071
Points
113
Location
MA
Your Mac's Specs
2022 Mac Studio M1 Max, 2023 M2 MBA
Are the .LOG file just text or something else? Can you open them in TextEdit and have them show something legible? If so, you can use a simple Terminal command to combine them all with something like:
Code:
cat *.log >> final.log

For example
Code:
# ls -l 
-rw-rw-r-- 1 <user> <group>  4 Mar 28 12:39 one.log
-rw-rw-r-- 1 <user> <group>  6 Mar 28 12:39 three.log
-rw-rw-r-- 1 <user> <group>  4 Mar 28 12:39 two.log

# cat one.log
One

# cat two.log
Two

# cat three.log
Three

# cat *.log >> final.log
# ls -l
-rw-rw-r-- 1 <user> <group> 14 Mar 28 12:39 final.log
-rw-rw-r-- 1 <user> <group>   4 Mar 28 12:39 one.log
-rw-rw-r-- 1 <user> <group>   6 Mar 28 12:39 three.log
-rw-rw-r-- 1 <user> <group>   4 Mar 28 12:39 two.log

# cat final.log
One
Three
Two

The reason I got One, Three, Two as opposed to One, Two, Three is that "*.log" is resolved alphabetically, so Three is before Two..

So in your case, to keep the things in proper order (if it matters), you want the files to be named/numbered in a manner in which they will show up in the order you want..
 
OP
W
Joined
May 2, 2005
Messages
173
Reaction score
0
Points
16
hey...thanks! It is a simple text file indeed.
I opened it in text edit and then started to past the files together and saved in a new text doc. It actually worked great...but I've got about 30 different .log files that I was trying to put together (trip was 2 months through Central America)...it seemed that it would work when I posted maybe 10 .log files together; but when I tried the whole thing, it seems not to work or be able to be read. I was using a free site called GPS Visualizer to view the files; so maybe it was a problem with that? Is there a limit to the number of text lines that it can read or it can only be a certain size? I just wanted to combine the 40 different days of travel route into one file that logged the journey of the entire trip...rather than opening 40 different files/days.
 

Raz0rEdge

Well-known member
Staff member
Moderator
Joined
Jul 17, 2009
Messages
15,745
Reaction score
2,071
Points
113
Location
MA
Your Mac's Specs
2022 Mac Studio M1 Max, 2023 M2 MBA

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top