Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

Say I have a bunch of files with nearly same filename, eg. data_timestep1, data_timestep2, ...

The data itself in one file is ({x1, y1, z1, absolute field value 1}, {x2, y2, z2, absolute field value 2}, ...), ASCII table data format

Now I want to put all data from all timestep files into one single file in the form:

({x1, y1, z1, absolute field value 1, timestep1}, {x1, y1, z1, absolute field value 1, timestep2}...,{x2, y2, z2, absolute field value 2, timestep1}, {x2, y2, z2, absolute field value 2, timestep2}...,)

so all vectors that belong to unique x, y, z position should be able to be read and sorted by the timestep value, to do FFT

Thanks for your tips

share|improve this question
This is probably just a simple application of StringCases/StringSplit and Sort on the filenames, followed by some Joins on the data, but the details will depend on the exact format, which you haven't provided. –  rm -rf Apr 15 '13 at 22:54
@rm-rf thanks, added it –  James Last Apr 16 '13 at 10:15
@JamesLast If you are still interested on automatic solution please create 2 files with 2-3 rows and attatch a link to them. –  Kuba Mar 28 '14 at 1:33

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.