Question: ```
echo -e 'one two three\nfour five six\nseven eight nine'
one two three
four five six
seven eight nine

```

how can I do some "MAGIC" do get this output?:

```
three
six
nine

```

UPDATE:
I don't need it in this specific way, I need a general solution so that no matter how many columns are in a row, e.g.: awk always displays the last column.

Answer: 
It can also be done using `'sed'`:

```
echo -e 'one two three\nfour five six\nseven eight nine' | sed -e 's/^.* \([^ ]*\)$/\1/'

```

**Update:**

or more simply:

```
echo -e 'one two three\nfour five six\nseven eight nine' | sed -e 's/^.* //'

```
In perl this can be done as follows:

```
#!/usr/bin/perl

#create a line of arbitrary data
$line = "1 2 3 4 5";

# splt the line into an array (we call the array 'array', for lolz)
@array = split(' ', $line);

# print the last element in the array, followed by a newline character;
print "$array[-1]\n";

```

output:

```
$ perl last.pl
5
$

```

You could also loop through a file, heres an example script I wrote to parse a file called budget.dat

example data in budget.dat:

```
Rent              500
Food              250
Car               300
Tax               100
Car Tax           120
Mag Subscription  15

```

(you can see i needed to capture only the "last" column, not column 2 only)

The script:

```
#!/usr/bin/perl
$budgetfile = "budget.dat";
open($bf, $budgetfile)
        or die "Could not open filename: $filename $!";

print "-" x 50, "\n";
while ( $row = <$bf> ) {
        chomp $row;
        @r = split (' ', $row);
        print "$row ";
        $subtotal += $r[-1];
        print "\t$subtotal\n";
}
print "-" x 50, "\n";
print "\t\t\t Total:\t$subtotal\n\n";

```