Geophysics survey grid

Hi All
Just learning arduino programming so my knowledge is small.
I have been learning how to save data to a arduino from a geophysical grid using a magnetometer. Now this requires me to walk over say a 20x20 grid up and down in a zig zag motion with a machine collecting data every metre. This data would then be exported to a programme similar to excel.
Now my problem is that collecting data in columns in the same direction is Ok but collecting the data in a zig zag will mean the 1st line being collected down the screen but the 2nd line having to be reversed. How would I programme that!
Does that make any sense to anyone.

Thanks

Does that make any sense to anyone.

Not to me I am afraid. Can you please explain the problem in more detail ?

How do you tell the program which direction you are walking and which grid cell you are in?

Thought that might be the case. I see I will have to do some programming first then get back to you when I hit the problem.
Thanks for coming on with your help.
I will be back.