This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

how do i filter ??

Old posts that have not been replied to for several years.
Locked
O
Ofloo
Owner
Posts: 953
Joined: Tue May 13, 2003 1:37 am
Location: Belguim
Contact:

how do i filter ??

Post by Ofloo »

I got a txt file that contains this the only line i would like to have is the 3rd line or beter yet C -> 29307/ 35MB the "35mb" how do i do this ?
Disk Space Free Space
--------------------------------
C -> 29307/ 35MB
D -> 419 / 0MB
E -> 690 / 0MB
User avatar
user
 
Posts: 1452
Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway

Post by user »

if the line number is static, 'open' and 'read' the file, 'split' the data on newlines (\n) and get the line you want the value from using 'lindex', then 'split' the line and get the last element (end) of the resulting list (lindex again).
O
Ofloo
Owner
Posts: 953
Joined: Tue May 13, 2003 1:37 am
Location: Belguim
Contact:

Post by Ofloo »

it is always the the 3rd line i want tnx for the reply if i don't understand something ill ask again ;) if you don't mind hehe
Locked