in reply to Breaking huge text file apart
If I'm understanding correctly, you have a file consisting of lines. Each line looks like
And you want to delete the spaces and the trailing text. If that's what you wanted, then you can use a simple substitution:CheatBook-DataBase 2001 v3.0 - http:://.... (50 spaces) some text
to remove the first 50 consecutive spaces it sees and everything after them.s/ {50}.*//;
However if what you want to keep is the stuff after the spaces, then you can use split this way:
Hope this helps,,,my $str = ... my @array = split /\s+/, $str; my $title = pop(@array); # get the last element # or even $str =~ / {50,}(.*)/; # match 50 or more spaces and capture # remaining text my $title = $1;
Aziz,,,
|
|---|