def test_read_col_starts():
 table = '\n#    5   9     17  18      28\n#    |   |       ||         |\n  John   555- 1234 192.168.1.10\n  Mary   555- 2134 192.168.1.12\n   Bob   555- 4527  192.168.1.9\n'
 dat = ascii.read(table, Reader=ascii.FixedWidthNoHeader, names=('Name', 'Phone', 'TCP'), col_starts=(0, 9, 18), col_ends=(5, 17, 28))
 assert_equal(tuple(dat.dtype.names), ('Name', 'Phone', 'TCP'))
 assert_equal(dat[0][1], '555- 1234')
 assert_equal(dat[1][0], 'Mary')
 assert_equal(dat[1][2], '192.168.1.')
 assert_equal(dat[2][2], '192.168.1')

def test_read_col_starts ( ) : table = '\n#    5   9     17  18      28\n#    |   |       ||         |\n  John   555- 1234 192.168.1.10\n  Mary   555- 2134 192.168.1.12\n   Bob   555- 4527  192.168.1.9\n' dat = ascii . read ( table , Reader = ascii . FixedWidthNoHeader , names = ( 'Name' , 'Phone' , 'TCP' ) , col_starts = ( 0 , 9 , 18 ) , col_ends = ( 5 , 17 , 28 ) ) assert_equal ( tuple ( dat . dtype . names ) , ( 'Name' , 'Phone' , 'TCP' ) ) assert_equal ( dat [ 0 ] [ 1 ] , '555- 1234' ) assert_equal ( dat [ 1 ] [ 0 ] , 'Mary' ) assert_equal ( dat [ 1 ] [ 2 ] , '192.168.1.' ) assert_equal ( dat [ 2 ] [ 2 ] , '192.168.1' )
table with no delimiter with column start and end values specified .