I want to import a large dataset to Lyx below, I currently compile it in Textmate. What is the most convenient way to import all macros and the table to LyX only for this document?
For the LaTeX code that belongs in the preamble, just copy/paste it into Document > Settings > LaTeX preamble. For the actual table, copy the LaTeX to the clipboard and then go to Edit > Paste Special > Paste from LaTeX. Note that this does not always work well because parsing arbitrary LaTeX (to convert it into LyX's internal format) is quite a difficult task.