I have a result of an sql query.it returns some 10 rows like below:
if i do the below in my perl script.
print $result
it gives me the output :
key value
----------- ------------------------------
1428116300 0003000
560779655 0003001
173413463 0003002
315642 0003003
1164414857 0003004
429589116 0003005
i just want to acheive that the first two lines to be deleted. and store the rest of each line in an array.
could any body please tell how do i achive this?
With something like :
Explanations :
split /\n/, $resultis cutting your variable into an array of lines.grep /^[\s\d]+$/is filtering this array, and only keeps the elements that are a single line of spaces or digits (thus removing the first two lines)