Still a newbie
Hi
If you trace the forums back you can probably see where im going...... Anyway Im very very new to this so bear with me... Im trying to edit a text file extracting only certain information from it... ie.. FILE -- arp.table ? (10.10.10.10) at 00:00:00:AA:AA:AA [ether] on eth0 ? (10.10.10.11) at 00:00:00:BB:BB:BB [ether] on eth0 RESULT WANTED 10.10.10.10 00:00:00:AA:AA:AA 10.10.10.11 00:00:00:BB:BB:BB and so on can anyone help Many thanks And for people like me this forum is a god send |
What method are you using to exit the text file? If you only need to parse the data and retrieve the result you wish, perl is a good choice. A regex can do that for you.. bash can do it, too (possibly using awk/sed -- I don't know these very well) but not as easily as perl. I guess the question is, what language are you wanting to use?
|
Basically im open to offers as im only just starting in this field. You said that Perl would be the easier choice so
How could i get perl to output only the results wanted as above. |
is this sufficient?
cut -d' ' -f2,4 arp.table | tr -d '()' |
Nice zeropash. I tend to think 'perl' first in many situations, and usually there are ways to do it already. That's nice. (=
|
I am a lazy guy ;)
|
Thanks a lot, thats worked great.
|
All times are GMT -5. The time now is 01:31 PM. |