def load_file(self, path=None, first_data_line='<STR_LIT>', filters='<STR_LIT>', text='<STR_LIT>', default_directory=None, header_only=False, quiet=False):
<EOL>if default_directory is None: default_directory = self.directory<EOL>if path == None:<EOL><INDENT>path = _s.dialogs.load(filters=filters,<EOL>default_directory=self.directory,<EOL>text=text)<EOL><DEDENT>self.path = path<EOL>if path is None:<EOL><INDENT>return None<EOL><DEDENT>if not _os.path.exists(path):<EOL><INDENT>if not quiet: print("<STR_LIT>"+repr(path)+"<STR_LIT>")<EOL>return None<EOL><DEDENT>self.clear()<EOL>f = open(path, '<STR_LIT:rb>')<EOL>if f.read(<NUM_LIT>).decode('<STR_LIT:utf-8>') == '<STR_LIT>':<EOL><INDENT>self.delimiter = f.read(<NUM_LIT:1>).decode('<STR_LIT:utf-8>')<EOL>s = '<STR_LIT:U+0020>'<EOL>while not s[-<NUM_LIT:1>] == '<STR_LIT:\n>': s = s+f.read(<NUM_LIT:1>).decode('<STR_LIT:utf-8>')<EOL>self.h(SPINMOB_BINARY = s.strip())<EOL>lines = ['<STR_LIT:\n>']<EOL>while not lines[-<NUM_LIT:1>] == '<STR_LIT>':<EOL><INDENT>s = '<STR_LIT:U+0020>'<EOL>while not s[-<NUM_LIT:1>] == '<STR_LIT:\n>': s = s+f.read(<NUM_LIT:1>).decode('<STR_LIT:utf-8>')<EOL>lines.append(s.strip())<EOL><DEDENT>lines.pop(-<NUM_LIT:1>)<EOL><DEDENT>f.close()<EOL>if not '<STR_LIT>' in self.hkeys:<EOL><INDENT>f = open(path, '<STR_LIT:r>')<EOL>lines = f.readlines()<EOL>f.close()<EOL>if self.delimiter is None:<EOL><INDENT>for n in range(len(lines)):<EOL><INDENT>s = lines[-n-<NUM_LIT:1>].strip()<EOL>if len(s) > <NUM_LIT:0>:<EOL><INDENT>if   _s.fun.is_a_number(s.split(None)[<NUM_LIT:0>]): self.delimiter = None<EOL>elif _s.fun.is_a_number(s.split('<STR_LIT:U+002C>') [<NUM_LIT:0>]): self.delimiter = '<STR_LIT:U+002C>'<EOL>elif _s.fun.is_a_number(s.split('<STR_LIT:;>') [<NUM_LIT:0>]): self.delimiter = '<STR_LIT:;>'<EOL>break<EOL><DEDENT><DEDENT><DEDENT><DEDENT>self.header_lines = []<EOL>for n in range(len(lines)):<EOL><INDENT>s = lines[n].strip().split(self.delimiter)<EOL>if len(s) and s[-<NUM_LIT:1>].strip() == '<STR_LIT>': s.pop(-<NUM_LIT:1>)<EOL>if first_data_line == "<STR_LIT>" and _s.fun.elements_are_numbers(s):<EOL><INDENT>first_data_line = n<EOL>break;<EOL><DEDENT>self.header_lines.append(lines[n].strip())<EOL>if len(s):<EOL><INDENT>hkey      = s[<NUM_LIT:0>]<EOL>if self.delimiter is None: remainder = '<STR_LIT:U+0020>'.join(s[<NUM_LIT:1>:])<EOL>else:                      remainder = self.delimiter.join(s[<NUM_LIT:1>:])<EOL>try: self.insert_header(hkey, eval(remainder, self._globals()))<EOL>except: self.insert_header(hkey, remainder)<EOL><DEDENT><DEDENT>if header_only: return self<EOL>if '<STR_LIT>' in self.hkeys:<EOL><INDENT>f = open(path, '<STR_LIT:rb>')<EOL>s = f.read()<EOL>f.close()<EOL>delimiter = self.delimiter.encode('<STR_LIT:utf-8>')<EOL>binary = self.h('<STR_LIT>')<EOL>size = eval('<STR_LIT>'+binary+'<STR_LIT>', dict(_n=_n))<EOL>start = s.find(b'<STR_LIT>',<NUM_LIT>) + <NUM_LIT:15><EOL>while not start >= len(s):<EOL><INDENT>stop  = s.find(delimiter, start)<EOL>if stop == -<NUM_LIT:1>: break<EOL>ckey  = s[start:stop].decode('<STR_LIT:utf-8>').strip()<EOL>start = stop+<NUM_LIT:1><EOL>stop  = s.find(b'<STR_LIT:\n>', start)<EOL>length = int(s[start:stop].strip())<EOL>start = stop+<NUM_LIT:1><EOL>stop  = start+size*length<EOL>self[ckey] = _n.fromstring(s[start:stop], binary)<EOL>start = stop+<NUM_LIT:1>        <EOL><DEDENT><DEDENT>else:<EOL><INDENT>if first_data_line == "<STR_LIT>" and not '<STR_LIT>' in self.hkeys:<EOL><INDENT>if not quiet: print("<STR_LIT>")<EOL>return self<EOL><DEDENT>if first_data_line == <NUM_LIT:0>: ckeys = []<EOL>else: ckeys = lines[first_data_line-<NUM_LIT:1>].strip().split(self.delimiter)<EOL>column_count = len(lines[first_data_line].strip().split(self.delimiter))<EOL>if len(ckeys) >= column_count:<EOL><INDENT>while len(ckeys) > column_count:<EOL><INDENT>extra = ckeys.pop(-<NUM_LIT:1>)<EOL>if not quiet: print("<STR_LIT>"+extra)<EOL><DEDENT><DEDENT>else:<EOL><INDENT>ckeys = []<EOL>for m in range(<NUM_LIT:0>, column_count): ckeys.append("<STR_LIT:c>"+str(m))<EOL><DEDENT>self.ckeys = []<EOL>while len(ckeys):<EOL><INDENT>ckey = ckeys.pop(<NUM_LIT:0>)<EOL>if (ckey in ckeys) or (ckey in self.ckeys):<EOL><INDENT>n=<NUM_LIT:0><EOL>while (ckey+"<STR_LIT:_>"+str(n) in ckeys) or (ckey+"<STR_LIT:_>"+str(n) in self.ckeys): n+=<NUM_LIT:1><EOL>ckey = ckey+"<STR_LIT:_>"+str(n)<EOL><DEDENT>self.ckeys.append(ckey)<EOL><DEDENT>for label in self.ckeys: self.columns[label] = []<EOL>try:<EOL><INDENT>def fix(x): return str(x.replace('<STR_LIT:i>','<STR_LIT>'))<EOL>z = _n.genfromtxt((fix(x) for x in lines[first_data_line:]),<EOL>delimiter=self.delimiter,<EOL>dtype=_n.complex)<EOL><DEDENT>except:<EOL><INDENT>def fix(x): return bytearray(x.replace('<STR_LIT:i>','<STR_LIT>'), encoding='<STR_LIT:utf-8>')        <EOL>z = _n.genfromtxt((fix(x) for x in lines[first_data_line:]),<EOL>delimiter=self.delimiter,<EOL>dtype=_n.complex)<EOL><DEDENT>if len(_n.shape(z)) == <NUM_LIT:1>:<EOL><INDENT>rows_of_data = len(lines) - first_data_line<EOL>if rows_of_data == <NUM_LIT:1>: z = _n.array([z])<EOL>else: z = _n.array(z)<EOL><DEDENT>if len(z.shape) == <NUM_LIT:2>: z = z.transpose()<EOL>else:                 z = [z]<EOL>for n in range(len(self.ckeys)):<EOL><INDENT>if _n.any(_n.imag(z[n])): self[n] = z[n]<EOL>else:                     self[n] = _n.real(z[n])<EOL><DEDENT><DEDENT>for k in self.obnoxious_ckeys:<EOL><INDENT>if k in self.columns:<EOL><INDENT>self.columns[self.obnoxious_ckeys[k]] = self.columns[k]<EOL><DEDENT><DEDENT>return self<EOL>
This will clear the databox, load a file, storing the header info in 
self.headers, and the data in self.columns

If first_data_line="auto", then the first data line is assumed to be 
the first line where all the elements are numbers.

If you specify a first_data_line (index, starting at 0), the columns 
need not be numbers. Everything above will be considered header 
information and below will be data columns.

In both cases, the line used to label the columns will always be the 
last header line with the same (or more) number of elements as the 
first data line.

Parameters
----------
path=None
    Path to the file. Using None will bring up a dialog.
filters='*.*'            
    Filter for the file dialog (if path isn't specified)
text='Select a file, FACEPANTS.'               
    Prompt on file dialog
default_directory=None
    Which spinmob.settings key to use for the dialog's default 
    directory. Will create one if it doesn't already exist.
header_only=False        
    Only load the header
quiet=False              
    Don't print anything while loading.