If I have a file test
which contains your example data the following will doing the job:
def extract_field(data, row, col):
'''extract_field -> string
`data` must be an iterable file object or an equivalent
data structure which elements contains space delimited
fields.
`row` and `col` declares the wished field position which
will be returned. '''
# cause first list element is 0
col -= 1
# jump to requested `row`
for _ in xrange(row):
line = next(data)
# create list with space delimited elements of `line`
# and return the `col`'s element of these list
return line.split()[col]
Use it like this:
>>> with open('test') as f:
... extract_field(f, row=3, col=2)
...
'AGCUCAGCUAGGC'