hadoop - pig latin equivalent for $cut -c16-19 <filename> -


i have following input record : 0029029070999991901010106004+64333+023450fm-12+000599999v0202701n015919999999n0000001n9-00781+99999102001addgf108991999999999999999999

no ' or space separated fields. columns can identified using position. year 1901 column c16-c19. unix/linux use cut -c16-19 filename.

how same (cut -c16-19 equivalent) in pig latin?

you should take @ substring function. example:

a = load '/user/hue/file.txt' using pigstorage; b = foreach generate substring($0, 15, 19); dump b;  result (1901) 

Comments

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -