I am trying to do a comparison to see if these two string arrays match.
I have tried assigning the array variable to another variable to get it to work but i can't figure it out. Here is what I have.
I want to check and see if string2 has string 1 at the end of it. The length of the numbers in string2 changes with each variable. I would like the if statement to look something like this
Hi,
I have a log file which shows the files which has been changed over the last week.
They follow this pattern:
old_file_version_number@@new_file_version_number
Now I need to know how to delete from each line parts starting from @@.
I would be issuing the command inside vi(m).
So... (5 Replies)
Hi guys, I hope you can help me with my problem.
I have a text file that contains lines like this:
78 ANGELO -809.05
79 ANGELO2 -5,000.06
I need to find all occurences of amounts that are negative and replace them with x's
78 ANGELO xxxxxxx
79... (4 Replies)
I would like to find a list of files in a directory less than 2 days old and put them into an array variable. And then search for each file in the array for a matching string say "Return-code= 0". If it matches, then display the array element with a message as "OK".
Your help will be greatly... (1 Reply)
Hello everyone, this is my first post so please give me a hand.
I apologize for my English, I'll try to be clear with my request.
I need to write a script (Bash) which finds all the variables defined in the file .h of the folder and then writes the name of the files .c where these variables are... (1 Reply)
Alo
I have this input:
0x10=some text
0x20=some text
0x30=some text
and want this output:
16=some text
32=some text
48=some text
I want to use a command to convert from hex to decimal i.e.:
$ echo $((0x15a))
or
$ printf '%d\n' 0x15a
I try to use something like this:
sed... (5 Replies)
Hi,
I have two files like this
file 1:
xxtcgtatccgaggga
cgcgcgggggagg
jjsjjjjsjjjdtcgtat
aaaaaaacccaaan
ggtcgtatffaadda
gggctggalllslllssdkk
file 2:
tcgtat
gctggaI want to 1) match each element of file2 to each element of file1.
2) delete all the matched alphabets and subsequent... (3 Replies)
I have an array and two variables as below,
I need to check if $datevar is present in $filename.
If so, i need to replace $filename with the values in the array.
I need the output inside an ARRAY
How can this be done.
Any help will be appreciated. Thanks in advance. (2 Replies)
So I need to create an array that has " in the string of the text:
string = ( "value 1" "value2"
where the actual string is "value1" with the quotations included
would this work?
string = ( \"value1\" \"value\")
and if the strings contain spaces as well:
string = ("\"this... (4 Replies)
Hi All,
My Problem is like below.
I have a file which contains just one row and contains data like
PO_CREATE12457888888888889SK1234567878744551111111111SK89456321145789955455555SK8888888815788852222
i want to extract SK12345678
SK89456321
SK88888888
So basically SK and next 8... (4 Replies)
Hi all,
Below is my script. It is currently working but I want some advice on maybe improving it and need some help on the pattern matching
xx.ksh:
#!/bin/ksh
#
# -------------------------------------------------------------------------------------------------
#
#Fatal NI connect error... (3 Replies)
Discussion started by: newbie_01
3 Replies
LEARN ABOUT PHP
array_diff
ARRAY_DIFF(3) 1 ARRAY_DIFF(3)array_diff - Computes the difference of arraysSYNOPSIS
array array_diff (array $array1, array $array2, [array $...])
DESCRIPTION
Compares $array1 against one or more other arrays and returns the values in $array1 that are not present in any of the other arrays.
PARAMETERS
o $array1
- The array to compare from
o $array2
- An array to compare against
o $...
- More arrays to compare against
RETURN VALUES
Returns an array containing all the entries from $array1 that are not present in any of the other arrays.
EXAMPLES
Example #1
array_diff(3) example
<?php
$array1 = array("a" => "green", "red", "blue", "red");
$array2 = array("b" => "green", "yellow", "red");
$result = array_diff($array1, $array2);
print_r($result);
?>
Multiple occurrences in $array1 are all treated the same way. This will output :
Array
(
[1] => blue
)
NOTES
Note
Two elements are considered equal if and only if (string) $elem1 === (string) $elem2. In words: when the string representation is
the same.
Note
This function only checks one dimension of a n-dimensional array. Of course you can check deeper dimensions by using
array_diff($array1[0], $array2[0]);.
SEE ALSO array_diff_assoc(3), array_intersect(3), array_intersect_assoc(3).
PHP Documentation Group ARRAY_DIFF(3)