Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
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

In reply to Re: Find Credit Card Numbers and Mask only 6 digits in a logfile by Marshall
in thread Find Credit Card Numbers and Mask only 6 digits in a logfile by gtk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • 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.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (5)
As of 2024-04-19 07:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found