in reply to
extract the value before a particualr string
I am looking for extracting a number between in the below line
How would you that using Perl?
The best way to get help is to try something first, show such and help will then bring understanding.
I would advise that you check How do I post a question effectively?.
Seeing that you are new here, I could give you a head up that solves the this dataset you posted like so:
print $1,$/ if/\s+?(\d+?)\/total$/;
Apples Orances:5433 55552246:777449 Country 457852/total
Apples Red:9987 green:777449 Public 74585/total
But of what help is that, if your dataset changes or you have a different input files?
Hope this helps.
If you tell me, I'll forget.
If you show me, I'll remember.
if you involve me, I'll understand.
--- Author unknown to me