TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I read the answers to this question: Import a text file into LaTeX document, and am now wondering if it's possible to let TeX replace tabs or spaces in that text-file with & for example if you export some data in comma or tab separated values from another source.

I do realize that it's simple to do that in any any text editor, but it would be convenient if some changes needed to be done on the source, not having to modify that text file over and over after exporting.

share|improve this question
If you can export your data as comma-separated values, then you may try using the csvtools package. – mpg Nov 16 '10 at 23:48
@mpg isn't datatool the successor to cvstools? – Will Robertson Nov 16 '10 at 23:52
@Will Yeah it seems so. This seems to be the solution to that problem. Doesn't it qualify as an answer? Or might there be other ways of doing this? – Jóhann Nov 16 '10 at 23:57
Alternatively, with write18 enabled might you be able to do some awk magic on the file before inputting it? – Seamus Aug 2 '11 at 17:29
up vote 3 down vote accepted

You want to use the fifinddo package, but its documentation isn't exactly obvious to me so I can't give you a minimal example :) I think you want §4 for details on how to use the package.

share|improve this answer

Your Answer


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

Not the answer you're looking for? Browse other questions tagged or ask your own question.