You can use pgfplotstable to separate the data and the table format
\documentclass{article}
\usepackage{pgfplotstable,booktabs}
% Just make a table of things
% It doesn't have to be in the preamble
% but just to show the idea, it's moved to here
\pgfplotstableread[col sep=comma]{
country, freq
Afghanistan ,AF
Aland Islands ,AX
Albania ,AL
Algeria ,DZ
American Samoa ,AS
Andorra ,AD
Angola ,AO
Anguilla ,AI
Antigua and Barbuda ,AG
Argentina ,AR
Armenia ,AM
Aruba ,AW
Australia ,AU
Austria ,AT
Azerbaijan ,AZ
Bahrain ,BH
Bangladesh ,BD
Barbados ,BB
Belarus ,BY
Belgium ,BE
Belize ,BZ
Benin ,BJ
Bermuda ,BM
Bhutan ,BT
Bolivia ,BO
Bosnia and Herzegovina ,BA
Botswana ,BW
Brazil ,BR
}\mycountryfreqtable
% Now the data is in the \mycountryfreqtable
% in the form of pgfplotstable format
\begin{document}
% This starts typesetting the table
\pgfplotstabletypeset[% Put some settings about the rules etc.
every head row/.style={before row=\toprule,after row=\midrule},
every last row/.style={after row=\bottomrule},
% Now insert as many column pairs as you want
% I want 3 groups of columns so repeated thrice
columns={country,freq,country,freq,country,freq},
% Then notice that index starts from zero and I want three parts
% so the command goes 0 of 3, 1 of 3 and 2 of 3
% You don't need to understand right away why
% just copy paste it.
display columns/0/.style={select equal part entry of={0}{3},string type},% first part of ‘A’
display columns/1/.style={select equal part entry of={0}{3},string type},% first part of ‘B’
display columns/2/.style={select equal part entry of={1}{3},string type},% second part of ‘A’
display columns/3/.style={select equal part entry of={1}{3},string type},% second part of ‘B’
display columns/4/.style={select equal part entry of={2}{3},string type},% first part of ‘A’
display columns/5/.style={select equal part entry of={2}{3},string type},% first part of ‘B’
]% End of options
{\mycountryfreqtable}
\end{document}
