I have a customer who logged some cc and bank account numbers in their apache logs. I got the cc numbers x'd out with
but that wasn't too difficult due to the value being 16 digits.
The bank account info is different, might be 6 digits, might be 10, might be 15. The actual string in the log entry will contain
somewhere in the middle of the line.
Now that I think about it, the new value doesn't have to match the original, meaning if it's a 7 digit value, I don't have to have 7 x's, I can replace the value, whatever the length, with say 7 or 10 x's. I'm just not sure how to identify the original variable length string.
Man, thanks for the quick replies everyone. I haven't played with any of them yet, I will after this post. But I wanted to give you the entire picture, just in case it helps, sorry should have put this in the orig post.
Here is a single entry from the log (edited of course)
I just need to x out this section
I need to keep all other entries, phone, address, zip, etc.
Again thanks a ton for the quick replies, I'm going to go test them now.
I started testing with the most recent posts and low and behold the last one from vgersh99 worked perfectly.
Many thanks to all of you for your efforts.
Vgersh99 if I could send you the beverage of your choice I would, but in this
medium you'll have to settle for a
My sample file is variable length, with out any field delimiters. It has min of 18 chars length and the 'CRLF' is potentially between 12-14 chars. How do I replace this with a space? I still want to keep end of record, but just want to remove these new lines chars in the middle of the data.
... (7 Replies)
Hello,
I've a file file_1.txt
ul.ln = 'Kb' AND (il.sum = 'ec7ccc92585adac28d9b1fb5eff0473f' or length('ec7ccc92585adac28d9b1fb5eff0473f') = 7);
il.sum = '20ddc1368d588dd0b0e37c41721e05b1' OR length('20ddc1368d588dd0b0e37c41721e05b1') = 7);
I need to replace the file like below -
ul.ln... (4 Replies)
I have a string like
Months=jan feb mar april x y ..
Here the number of fields in Months is not definite
I need to extract each field in the Months string and pass it to awk . Don't want to use for in since it is a loop . How can i do it (2 Replies)
Hi guys
I am having this strange issue.Well my requirement is like below
Compare two values between flat file and oracle DB
Via perl script I am easily getting the rowcount
Now I connect sql plus via perl and the column value that returns is string
my $sqlplus_settings = '';
my... (7 Replies)
Can someone tell me how to change the first column in a very large 17k line file from a random 10 digit numeric value to a non numeric value. The format of lines in the file is:
1702938475,SNU022,201004
the first 10 numbers always begin with 170 (6 Replies)
Hi all,
I am trying to find the best way of making a change to 1 char in a string, the string can be between 1 and 14 characters.
I am reading a line in from a file which contains
012341231231:2:102939283:NNN: Require :NBN:
012838238232:3:372932:NNN: Require :NNB:
I need to change 1 N or a... (8 Replies)
Hello,
I really would appreciate some help with a bash script for some string manipulation on an SQL dump:
I'd like to be able to rename "sites/WHATEVER/files" to "sites/SOMETHINGELSE/files" within the sql dump.
This is quite easy with sed:
sed -e... (1 Reply)
given a string passed to a program that supposed to be numeric and of a certain length say 8 digits - so say for e.g. need to verify this 01234567
How would I parse this string to validat it meet requirements
I tried to use * | sed /\(\{8})/
Thanks in advance (1 Reply)