I don't understand this: "The problem is to identify the number in the file because I cannot open the file because sometimes files are too large.". Maybe you are trying to read the whole file into memory at once? Open the file and read it line by line. Use a regex to modify the number, perhaps something as simple as this:
use strict;
use warnings;
my $n = 'asdfklj fuyy23 1234567890123456 78vc';
$n =~ s/(\d{6,6})(\d{6,6})(\d{4,4})/$1******$3/;
print "$1 $2 $3\n";
print $n;
__END__
123456 789012 3456
asdfklj fuyy23 123456******3456 78vc
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|