def extract_line_from_file(fn, iline=1, comment='#', fill_trailing_empty=True): 
	""" 
	return the iline-th line of the file which is non-empty and does not start with the comment ('#' by default).  
	if fill_trailing_emtpy is True then if iline is larger than the number of lines then return comma seperated empty values with the size the same as the header line. 

	iline could be either integer or slice instances, such as iline=slice(1, None, None) will return all lines after the first one. 

	Params
	------
	fn (str)
	iline=1 (int or slice instance)
	comment='#'
	fill_trailing_empty=True

	Return 
	------
	list of strings (lines)
	"""

	with open(fn, 'r') as f:
		data = f.read()
	lines = data.split('\n')

	lines_noncomment = []
	for line in lines:
		if len(line) > 0:
			if (line[0] != comment):
				lines_noncomment += [line]

	if isinstance(iline, slice):
		return lines_noncomment[iline]

	elif iline < len(lines_noncomment): 
		return lines_noncomment[iline]

	elif fill_trailing_empty and len(lines_noncomment)>0:
		n_comma = lines_noncomment[0].count(',') 
		return "," * n_comma

	else:
		raise Exception("[batch] _extract_line_from_file iline exceeding the number of lines")