I have a flat txt file, I would like to grab the last line of field's first.
the second last line place second
the third last line place third..
and so on..
example data file :
Lewis W|red|CO|no|18:10 ET|yes|2/21/2005
WINSLEY J|green|La|yes|18:29 ET|no|2/21/2005
Harold P|no|Ab|yes|19:07 ET|yes|2/21/2005
output
field[1] - field[5] - field[7] - field[2]
or
Harold P - 19:07 ET - 2/21/2005 - no
This is my script so far, I would probably have a limit to only return the last 25 lines only.
<?php
$lines = file('/home/data/cs.data');
foreach ($lines as $line) {
$parts = explode('|', $line);
echo " ";
}}