in reply to Grabbing first column of text
Try one of these one-liners (they have the same output, but I thought the second might be a little easier to understand):
perl -ple '($_) = /^\S+/g' filename perl -ple '$_ = (/^\S+/g)[0]' filename
Basically, it reads a line, then sets it to the first group of non-whitespace stuff at the beginning of the line, and then prints the changed line out. Hope this helps!
His Royal Cheeziness
|
|---|