01-21-2008
thank you for your quick post. I was wondering if this can be done with awk ?
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi All,
Thanks for your help in advance
I am parsing a log file where the first field of each line can have the same key value but not more than 3 times in a row. Varying value of that first field changes as you go through the log but it either appears 3 times or two and sometimes only once.... (1 Reply)
Discussion started by: dragrid
1 Replies
2. Shell Programming and Scripting
Hi,
I want to get script or command in Sun Unix which matches first fields of both the files and print the feilds of one files, example may make it more clear.
InputFile1
==================
Alex,1,fgh
Menthos,45454,toto
Gothica,855,ee
Zenie4,77,gg
Salvatore,66,oo
Dhin,1234,papapa... (3 Replies)
Discussion started by: indian.ace
3 Replies
3. Shell Programming and Scripting
Hello,
I have two files that have the date field as a common. I request your help with some script that divide the value of the file1 by the value in the file2 only when the field date are the same between both files and create a new text file.
This is a sample of the files
file1... (1 Reply)
Discussion started by: csierra
1 Replies
4. Shell Programming and Scripting
First, thanks for the help in previous posts... couldn't have gotten where I am now without it!
So here is what I have, I use AWK to match $1 and $2 as 1 string in file1 to $1 and $2 as 1 string in file2. Now I'm wondering if I can extend this AWK command to incorporate the following:
If $1... (4 Replies)
Discussion started by: right_coaster
4 Replies
5. UNIX for Dummies Questions & Answers
Hi !
I have a tab-delimited file, file.tab:
Column1 Column2 Column3
aaaaaaaaaa bbtomatoesbbbbbb cccccccccc
ddddddddd eeeeappleseeeeeeeee ffffffffffffff
ggggggggg hhhhhhtomatoeshhh iiiiiiiiiiiiiiii
... (18 Replies)
Discussion started by: lucasvs
18 Replies
6. Shell Programming and Scripting
hello,
i have a little problem, i want match the complete field ($1 or $2) with a complete word in another variable.
example:
i have a file with either one or two words per lane:
hsa-mir-4449
hsa-mir-4707
hsa-mir-4707* hsa-mir-4707
novelMiR_3551 novelMiR_3563
novelMiR_4330... (4 Replies)
Discussion started by: ace13
4 Replies
7. Shell Programming and Scripting
Hi,
I have a file of csv data, which looks like this:
file1:
1AA,LGV_PONCEY_LES_ATHEE,1,\N,1,00020460E1,0,\N,\N,\N,\N,2,00.22335321,0.00466628
2BB,LES_POUGES_ASF,\N,200,200,00006298G1,0,\N,\N,\N,\N,1,00.30887539,0.00050312... (10 Replies)
Discussion started by: djoseph
10 Replies
8. Shell Programming and Scripting
Hello,
I have a text file in the below format:
Source Destination State Lag Status
CQA02W2K12pl:D:\CAQA ... (10 Replies)
Discussion started by: pocodot
10 Replies
9. Shell Programming and Scripting
In the awk below I use $2 of filet to search filea for a match. If the values in $2 are exact match this works great. However, that is not always the case, so I need to perform the search using a range of + or - 2. That is if the value in filea $2 is within + or - 2 of filet $2 then it is matched.... (6 Replies)
Discussion started by: cmccabe
6 Replies
10. Shell Programming and Scripting
I am trying to look for $2 of file1 (skipping the header) in $2 of file2 (skipping the header) and if they match and the value in $10 is > 30 and $11 is > 49, then print the line from file1 to a output file. If no match is foung the line is not printed. Both the input and output are tab-delimited.... (3 Replies)
Discussion started by: cmccabe
3 Replies
LEARN ABOUT PHP
imap_search
IMAP_SEARCH(3) 1 IMAP_SEARCH(3)
imap_search - This function returns an array of messages matching the given search criteria
SYNOPSIS
array imap_search (resource $imap_stream, string $criteria, [int $options = SE_FREE], [string $charset = NIL])
DESCRIPTION
This function performs a search on the mailbox currently opened in the given IMAP stream.
For example, to match all unanswered messages sent by Mom, you'd use: "UNANSWERED FROM mom". Searches appear to be case insensitive. This
list of criteria is from a reading of the UW c-client source code and may be incomplete or inaccurate (see also RFC2060, section 6.4.4).
PARAMETERS
o $
imap_stream -An IMAP stream returned by imap_open(3).
o $criteria
- A string, delimited by spaces, in which the following keywords are allowed. Any multi-word arguments (e.g. FROM "joey smith")
must be quoted. Results will match all $criteria entries.
o ALL - return all messages matching the rest of the criteria
o ANSWERED - match messages with the \ANSWERED flag set
o BCC "string" - match messages with "string" in the Bcc: field
o BEFORE "date" - match messages with Date: before "date"
o BODY "string" - match messages with "string" in the body of the message
o CC "string" - match messages with "string" in the Cc: field
o DELETED - match deleted messages
o FLAGGED - match messages with the \FLAGGED (sometimes referred to as Important or Urgent) flag set
o FROM "string" - match messages with "string" in the From: field
o KEYWORD "string" - match messages with "string" as a keyword
o NEW - match new messages
o OLD - match old messages
o ON "date" - match messages with Date: matching "date"
o RECENT - match messages with the \RECENT flag set
o SEEN - match messages that have been read (the \SEEN flag is set)
o SINCE "date" - match messages with Date: after "date"
o SUBJECT "string" - match messages with "string" in the Subject:
o TEXT "string" - match messages with text "string"
o TO "string" - match messages with "string" in the To:
o UNANSWERED - match messages that have not been answered
o UNDELETED - match messages that are not deleted
o UNFLAGGED - match messages that are not flagged
o UNKEYWORD "string" - match messages that do not have the keyword "string"
o UNSEEN - match messages which have not been read yet
o $options
- Valid values for $options are SE_UID, which causes the returned array to contain UIDs instead of messages sequence numbers.
o $charset
-
RETURN VALUES
Returns an array of message numbers or UIDs.
Return FALSE if it does not understand the search $criteria or no messages have been found.
EXAMPLES
Example #1
imap_search(3) example
<?php
$conn = imap_open('{imap.example.com:993/imap/ssl}INBOX', 'foo@example.com', 'pass123', OP_READONLY);
$some = imap_search($conn, 'SUBJECT "HOWTO be Awesome" SINCE "8 August 2008"', SE_UID);
$msgnos = imap_search($conn, 'ALL');
$uids = imap_search($conn, 'ALL', SE_UID);
print_r($some);
print_r($msgnos);
print_r($uids);
?>
The above example will output something similar to:
Array
(
[0] => 4
[1] => 6
[2] => 11
)
Array
(
[0] => 1
[1] => 2
[2] => 3
[3] => 4
[4] => 5
[5] => 6
)
Array
(
[0] => 1
[1] => 4
[2] => 6
[3] => 8
[4] => 11
[5] => 12
)
SEE ALSO
imap_listscan(3).
PHP Documentation Group IMAP_SEARCH(3)