Hi Guys,
I have a file as follows. Here is my story:
For each field, the string in the 5th column needs to be searched in other fields of the same column and counted if the 1st column of the field is different from that of the primary field. BTW, the unique strings of 1st column need to be considered. Sorry if this is too complicated. Let me clarify it with this example. Here is my file (tab delimited):
Now the counts are reported in a new column:
Thanks a lot in advance!
Last edited by a_bahreini; 01-28-2014 at 08:11 PM..
I need to count the number of files which have a search string, but counting the file only once
if search string is found.
eg: File1: Please note that there are 2 occurances of "aaa"
aaa
bbb
ccc
aaa
File2: Please note that there are 3 occurances of "aaa"
aaa
bbb
ccc... (1 Reply)
I have an archive file that holds a batch of statements. I would like to be able to extract a certain statement based on the unique customer # (ie. 123456). The end for each statement is noted by "ENDSTM".
I can find the line number for the beginning of the statement section with sed.
... (5 Replies)
I am trying to search a file for a patterns ERR- in a file and return a count for each of the error reported
Input file is a free flowing file without any format
example of output
ERR-00001=5
....
ERR-01010=10
.....
ERR-99999=10 (4 Replies)
I need to search the file using strings "Request Type" , " Request Method" , "Response Type" and by using result set find the xml tags and convert into a single line?. below are the scenarios.
Cat test
Nov 10, 2012 5:17:53 AM
INFO: Request Type
Line 1.... (5 Replies)
Im looking for an awk script that will take the unique values in column 5, then print and count the unique values in column 6.
CA001011500 11111 11111 -9999 201301 AAA
CA001012040 11111 11111 -9999 201301 AAA
CA001012573 11111 11111 -9999 201301 BBB
CA001012710 11111 11111 -9999 201301... (4 Replies)
Hello Team,
I need your help on the following:
My input file a.txt is as below:
3330690|373846|108471
3330690|373846|108471
0640829|459725|100001
0640829|459725|100001
3330690|373847|108471
Here row 1 and row 2 of column 1 are identical but corresponding column 2 value are... (4 Replies)
Hello experts,
I am converting a number into its binary output as :
read n
echo "obase=2;$n" | bc
I wish to count the maximum continuous occurrences of the digit 1.
Example :
1. The binary equivalent of 5 = 101. Hence the output must be 1.
2. The binary... (3 Replies)
Hello,
I am trying to count unique rows in my file based on 4 columns (2-5) and to output its frequency in a sixth column. My file is tab delimited
My input file looks like this:
Colum1 Colum2 Colum3 Colum4 Coulmn5
1.1 100 100 a b
1.1 100 100 a c
1.2 200 205 a d
1.3 300 301 a y
1.3 300... (6 Replies)
Discussion started by: nans
6 Replies
LEARN ABOUT PHP
odbc_result
ODBC_RESULT(3) 1 ODBC_RESULT(3)odbc_result - Get result dataSYNOPSIS
mixed odbc_result (resource $result_id, mixed $field)
DESCRIPTION
Get result data
PARAMETERS
o $result_id
- The ODBC resource.
o $field
- The field name being retrieved. It can either be an integer containing the column number of the field you want; or it can be a
string containing the name of the field.
RETURN VALUES
Returns the string contents of the field, FALSE on error, NULL for NULL data, or TRUE for binary data.
EXAMPLES
The first call to odbc_result(3) returns the value of the third field in the current record of the query result. The second function call
to odbc_result(3) returns the value of the field whose field name is "val" in the current record of the query result. An error occurs if a
column number parameter for a field is less than one or exceeds the number of columns (or fields) in the current record. Similarly, an
error occurs if a field with a name that is not one of the fieldnames of the table(s) that is(are) being queried.
Example #1
odbc_result(3) examples
<?php
$item_3 = odbc_result($Query_ID, 3);
$item_val = odbc_result($Query_ID, "val");
?>
NOTES
Field indices start from 1. Regarding the way binary or long column data is returned refer to odbc_binmode(3) and odbc_longreadlen(3).
PHP Documentation Group ODBC_RESULT(3)