Below is the scenario. Help is appreciated.
File1: ( 500,000 lines ) : Three fields comma delimited : Not sorted
1234FAA,435612,88975
1224FAB,12345,212356
File2: ( 4,000,000 lines ) : Six fields comma delimited (Last 3 field should match the 3 fields of File1) : Not Sorted :
... (13 Replies)
I have data, from which I want to grep for two fields. Only pull out the data if both the fields exist.
I have used: egrep --text "field1|field2" file > temp. This seems to be doing an OR. What I am after is an AND. (10 Replies)
Hi all,
Currently I have this:
ps -eo pid,comm| grep CSORDB1T
But I need to grep LOCAL=NO as well:
ps -eo pid,comm| grep CSORDB1T |grep LOCAL=NO >pdwh_pid
However, there's no output. Plz advise how can we grep CSORDB1T & LOCAL=NO at the same time.
Thanks! (8 Replies)
Hi All,
My main intension of is to convert the Hexstring stored in a char* into hex and then prefixing it with "0x" and suffix it with ','
This has to be done for all the hexstring char* is NULL.
Store the result prefixed with "0x" and suffixed with ',' in another char* and pass it to... (1 Reply)
Hi,
I have a pipe delimited file. I am checking for junk characters ( non printable characters and unicode values).
I am using the following code
grep '' file.txt
But i want to ignore the name fields. For example field2 is firstname so i want to ignore if the junk characters occur... (4 Replies)
Hi,
Is there really a difference between these two, std::hex and ios::hex??
I stumbled upon reading a line, "std::ios::hex is a bitmask (8 on gcc) and works with setf(). std::hex is the operator". Is this true?
Thanks (0 Replies)
Hi,
I want to split/parse certain bits of the hex data into another field.
Example:
Input data is
Word1: 4f72abfd
Output:
Parse bits (5 to 0) into field word1data1=0x00cd=205 decimal
Parse bits (7 to 6) into field word1data2=0x000c=12 decimal
etc.
Word2: efff3d02
Parse bits (13 to... (1 Reply)
I have 32 bit value in hex that I want to separate into fields and then convert the fields into decimal values.
Input file has 2 words of 32 bit hex values:
000001ac
ca85210e
Output both words separated into individual bit fields:
ca85210e: f1(31:9), f2(8:0)
f7c392ac: f1(31:14),... (2 Replies)
Hello,
I met a challenge to extract part of the table. I'd like to grep the first three matches based on field1 and field2. Input:
D A 92.85 1315 83 11
D A 95.90 757 28 3
D A 94.38 480 20 7
D A 91.21 307 21 6
D A 94.26 244 ... (6 Replies)
I have two files
file1 : USER CURR_TIMES FAIL_CO F_TIME LAST_O_TIME
---------- -------------------------- ------------ ------------------- -------------------
T123 2017-02-25 19:16:58 GMT 3 2017-02-25 13:28:29 2017-02-25 13:42:31
K123 2017-02-25 19:16:58 GMT 3 2017-02-25... (1 Reply)
Discussion started by: jhonnyrip
1 Replies
LEARN ABOUT PHP
openssl_random_pseudo_bytes
OPENSSL_RANDOM_PSEUDO_BYTES(3) 1 OPENSSL_RANDOM_PSEUDO_BYTES(3)openssl_random_pseudo_bytes - Generate a pseudo-random string of bytesSYNOPSIS
string openssl_random_pseudo_bytes (int $length, [bool &$crypto_strong])
DESCRIPTION
Generates a string of pseudo-random bytes, with the number of bytes determined by the $length parameter.
It also indicates if a cryptographically strong algorithm was used to produce the pseudo-random bytes, and does this via the optional
$crypto_strong parameter. It's rare for this to be FALSE, but some systems may be broken or old.
PARAMETERS
o $length
- The length of the desired string of bytes. Must be a positive integer. PHP will try to cast this parameter to a non-null integer
to use it.
o $crypto_strong
- If passed into the function, this will hold a boolean value that determines if the algorithm used was "cryptographically
strong", e.g., safe for usage with GPG, passwords, etc. TRUE if it did, otherwise FALSE
RETURN VALUES
Returns the generated string of bytes on success, or FALSE on failure.
EXAMPLES
Example #1
openssl_random_pseudo_bytes(3) example
<?php
for ($i = -1; $i <= 4; $i++) {
$bytes = openssl_random_pseudo_bytes($i, $cstrong);
$hex = bin2hex($bytes);
echo "Lengths: Bytes: $i and Hex: " . strlen($hex) . PHP_EOL;
var_dump($hex);
var_dump($cstrong);
echo PHP_EOL;
}
?>
The above example will output something similar to:
Lengths: Bytes: -1 and Hex: 0
string(0) ""
NULL
Lengths: Bytes: 0 and Hex: 0
string(0) ""
NULL
Lengths: Bytes: 1 and Hex: 2
string(2) "42"
bool(true)
Lengths: Bytes: 2 and Hex: 4
string(4) "dc6e"
bool(true)
Lengths: Bytes: 3 and Hex: 6
string(6) "288591"
bool(true)
Lengths: Bytes: 4 and Hex: 8
string(8) "ab86d144"
bool(true)
SEE ALSO random_bytes(3), bin2hex(3), crypt(3), mt_rand(3), uniqid(3).
PHP Documentation Group OPENSSL_RANDOM_PSEUDO_BYTES(3)