def writeGCE_table(filename,headers,data,dcols=['<STR_LIT>','<STR_LIT>','<STR_LIT>','<STR_LIT:A>'],header_char='<STR_LIT:H>',sldir='<STR_LIT:.>',sep='<STR_LIT:&>'):
import re<EOL>from . import utils as u<EOL>if not '<STR_LIT:->' in data[<NUM_LIT:0>][<NUM_LIT:0>]:<EOL><INDENT>iso_inp=False<EOL>dcols=dcols+['<STR_LIT>']<EOL><DEDENT>else:<EOL><INDENT>iso_inp=True<EOL>dcols=dcols+['<STR_LIT>','<STR_LIT:A>']<EOL><DEDENT>if iso_inp==True:<EOL><INDENT>data.append([])<EOL>data.append([])<EOL>u.convert_specie_naming_from_h5_to_ppn(data[<NUM_LIT:0>])<EOL>Z=u.znum_int<EOL>A=u.amass_int<EOL>for i in range(len(data[<NUM_LIT:0>])):<EOL><INDENT>zz=str(int(Z[i]))<EOL>aa=str(int(A[i]))<EOL>data[<NUM_LIT:1>][i]='<STR_LIT>'.format(data[<NUM_LIT:1>][i])+'<STR_LIT:U+0020>'<EOL>data[-<NUM_LIT:2>].append(zz)<EOL>data[-<NUM_LIT:1>].append(aa)<EOL><DEDENT><DEDENT>else:<EOL><INDENT>fake_iso=[]<EOL>for k in range(len(data[<NUM_LIT:0>])):<EOL><INDENT>fake_iso.append(data[<NUM_LIT:0>][k]+'<STR_LIT>')<EOL>data.append([])<EOL>u.convert_specie_naming_from_h5_to_ppn(fake_iso)<EOL>Z=u.znum_int<EOL><DEDENT>for i in range(len(data[<NUM_LIT:0>])):<EOL><INDENT>zz=str(int(Z[i]))<EOL>data[<NUM_LIT:1>][i]='<STR_LIT>'.format(data[<NUM_LIT:1>][i])+'<STR_LIT:U+0020>'<EOL>data[-<NUM_LIT:1>].append(zz)<EOL><DEDENT><DEDENT>if sldir.endswith(os.sep):<EOL><INDENT>filename = str(sldir)+str(filename)<EOL><DEDENT>else:<EOL><INDENT>filename = str(sldir)+os.sep+str(filename)<EOL><DEDENT>tmp=[] <EOL>lines=[]<EOL>lengthList=[]<EOL>if os.path.exists(filename):<EOL><INDENT>print('<STR_LIT>'+ filename)<EOL><DEDENT>if len(data)!=len(dcols):<EOL><INDENT>print('<STR_LIT>')<EOL>print('<STR_LIT>')<EOL>return None<EOL><DEDENT>for i in range(len(headers)):<EOL><INDENT>tmp.append(header_char+'<STR_LIT:U+0020>'+headers[i]+'<STR_LIT:\n>')<EOL><DEDENT>headers=tmp<EOL>tmp='<STR_LIT>'<EOL>for i in range(len(data)): <EOL><INDENT>length=len(dcols[i])+<NUM_LIT:1><EOL>for j in range(len(data[i])):<EOL><INDENT>tmp2=data[i][j]<EOL>if isinstance(data[i][j],float):<EOL><INDENT>tmp2='<STR_LIT>'.format(data[i][j])+'<STR_LIT:U+0020>'<EOL>data[i][j] = tmp2<EOL><DEDENT>if len(str(tmp2))>length:<EOL><INDENT>length=len(str(tmp2))<EOL><DEDENT><DEDENT>lengthList.append(length)<EOL><DEDENT>tmp='<STR_LIT>'<EOL>tmp1='<STR_LIT>'<EOL>for i in range(len(dcols)):<EOL><INDENT>tmp1=dcols[i]<EOL>if len(dcols[i]) < lengthList[i]:<EOL><INDENT>j=lengthList[i]-len(dcols[i])<EOL>for k in range(j):<EOL><INDENT>tmp1+='<STR_LIT:U+0020>'<EOL><DEDENT><DEDENT>tmp+=sep+tmp1<EOL><DEDENT>tmp+='<STR_LIT:\n>'<EOL>dcols=tmp<EOL>tmp='<STR_LIT>'<EOL>for i in range(len(data[<NUM_LIT:0>])):<EOL><INDENT>for j in range(len(data)):<EOL><INDENT>if type(data[j][i]) == str:<EOL><INDENT>tmp1=data[j][i]<EOL>if len(str(data[j][i])) < lengthList[j]:<EOL><INDENT>l=lengthList[j]-len(tmp1)<EOL>for k in range(l):<EOL><INDENT>tmp1+='<STR_LIT:U+0020>'<EOL><DEDENT><DEDENT>extra='<STR_LIT>'<EOL><DEDENT>tmp+=sep+tmp1<EOL><DEDENT>lines.append(tmp+'<STR_LIT:\n>')<EOL>tmp='<STR_LIT>'<EOL><DEDENT>f=open(filename,'<STR_LIT:a>')<EOL>for i in range(len(headers)):<EOL><INDENT>f.write(headers[i])<EOL><DEDENT>f.write(dcols)<EOL>for i in range(len(lines)):<EOL><INDENT>f.write(lines[i])<EOL><DEDENT>f.close()<EOL>return None<EOL>
Method for writeing data in GCE format in Ascii files.
Reads either elements or isotopes
dcols[0] needs to contain either isotopes or elements

Note the attribute name at position i in dcols will be associated
with the column data at index i in data.
Also the number of data columns(in data) must equal the number
of data attributes (in dcols)
Also all the lengths of that columns must all be the same.
Input:
filename: The file where this data will be written.
Headers: A list of Header strings or if the file being written
     is of type trajectory, this is a List of strings
     that contain header attributes and their associated
     values which are seperated by a '='.
dcols: A list of data attributes
data:  A list of lists (or of numpy arrays).
header_char  the character that indicates a header lines
sldir: Where this fill will be written.
sep: What seperatesa the data column attributes
trajectory: Boolean of if we are writeing a trajectory type file