Page 1 of 1

Search last column in a row

Posted: 13 Jan 2011 02:34
by darioit
Hello everybody,

how can I get the last column in a raw in a variable record length row?
Example

1237894b2376q2786ho8
21374y723dno
1237d8923717234 85710d5d1n

result
8
o
n

Regards
Dario

Re: Search last column in a row

Posted: 13 Jan 2011 04:21
by !k
echo %var:~-1%
Read set/? for details

Re: Search last column in a row

Posted: 13 Jan 2011 04:48
by darioit
Great many Thanks

Re: Search last column in a row

Posted: 13 Jan 2011 18:25
by ghostmachine4
you can use gawk

Code: Select all

gawk -vFS= "{print $(NF)}" file