Numerous shell commands output data in a human-readable format like this one on Mac OS X. How can one use RegEx to parse out each line into an array of values knowing that you can’t simply use “whitespace” as a variable as the final column is a path and paths may contain spaces as well.
MBP:~ me$ lsof
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
loginwind 97 me cwd DIR 1,4 1122 2 /
loginwind 97 me txt REG 1,4 840176 20150460 /System/Library/CoreServices/loginwindow.app/Contents/MacOS/loginwindow
loginwind 97 me txt REG 1,4 76240 20068359 /System/Library/Extensions/AppleHDA.kext/Contents/PlugIns/AppleHDAHALPlugIn.bundle/Contents/MacOS/AppleHDAHALPlugIn
loginwind 97 me txt REG 1,4 55248 12563538 /System/Library/ColorSync/Profiles/Generic CMYK Profile.icc
loginwind 97 me txt REG 1,4 35904 12944831 /System/Library/Caches/com.apple.IntlDataCache.le.kbdx
loginwind 97 me txt REG 1,4 50744 22475037 /private/var/db/mds/system/mdsDirectory.db
loginwind 97 me txt REG 1,4 1960 12563542 /System/Library/ColorSync/Profiles/Generic RGB Profile.icc
loginwind 97 me txt REG 1,4 24439776 20082672 /usr/share/icu/icudt53l.dat