If pattern in column 3 matches pattern in column 2 (any row), print value in column 1
Hi all,
I have searched and searched, but I have not found a solution that quite fits what I am trying to do.
I have a long list of data in three columns. Below is a sample:
Moderator's Comments:
Please use code tags
What I need to do is as follows: If a number in column three matches a number in column two, print "," and the number in the corresponding row in column one. If there is no match, just print ",". So an expected result for the sample would be as follows:
I've assumed that AWK would be the best tool for this task, but I am open to using any tool. The solutions I have found and tried only match corresponding rows. They don't match a pattern in one column to any pattern in another column. I'm guessing a loop may be required, but I am a novice to looping.
The values in column one are just the ordinal numbers for the rows, if that is relevant to a solution.
I am very grateful for any help. Thank you.
Last edited by jim mcnamara; 06-04-2019 at 10:30 AM..
Hi,
I want to replace a column in a file if it matches certain pattern. Can you help me on this.
Here is the file content.
000000 1111111 2222222
011111 0123445 1234556
023445 1111111 2343455
if second column contains 1111111 i need to replace it with 0000000
Can you... (6 Replies)
Hi there,
I've an input file1 as follows:
1001
1002
1003
1004
1005
I would like to have an output file2 as follows:
Numbers are 1001/ 1002/ 1003/ 1004/ 1005/
Any help is appreciated. (2 Replies)
Given a file such as this I need to remove the duplicates.
00060011 PAUL BOWSTEIN ad_waq3_921_20100826_010517.txt
00060011 PAUL BOWSTEIN ad_waq3_921_20100827_010528.txt
0624-01 RUT CORPORATION ad_sade3_10_20100827_010528.txt
0624-01 RUT CORPORATION ... (13 Replies)
Can anyone please help with this? I have 2 files as given below.
If 2nd column of file1 has pattern foo1@a, find the matching 1st column in file2 & replace 2nd column of file1 with file2's value.
file1
abc_1 foo1@a ....
abc_1 soo2@a ...
def_2 soo2@a ....
def_2 foo1@a ........ (7 Replies)
Hi All,
I have been trying to transpose rows to column in an large file (about 15000 lines) between matching pattern. Searched all posts in this forum, but not able find the solution to my problem. Any help appreciated.!!
Input
/*------XXXXXX-------*/
owner: XXXX
location: XXXX... (3 Replies)
This is my input file :
# cat list 20130430121600, cucm, location,76,2 20130430121600,cucm1,location1,76,4 20130430122000,cucm,location,80,8 20130430122000,cucm1,location1,90,8 20130430140000,cucm1,location1,87,11 20130430140000, cucm,location,67,9
This is the required output
... (1 Reply)
Hi,
My input files is like this
axis1 0 1 10
axis2 0 1 5
axis1 1 2 -4
axis2 2 3 -3
axis1 3 4 5
axis2 3 4 -1
axis1 4 5 -6
axis2 4 5 1
Now, these are my following tasks
1. Print a first column for every two rows that has the same value followed by a string.
2. Match on the... (3 Replies)
I have one requirement to delete all lines from a file if it matches below scenario. File contains three column. Employee Number, Employee Name and Employee ID
Scenario is: delete all line if Employee Number (1st column) contains below
1. Non-numeric Employee Number
2. Employee Number that... (3 Replies)
Discussion started by: anshu ranjan
3 Replies
LEARN ABOUT PHP
db2_column_privileges
DB2_COLUMN_PRIVILEGES(3) 1 DB2_COLUMN_PRIVILEGES(3)db2_column_privileges - Returns a result set listing the columns and associated privileges for a tableSYNOPSIS
resource db2_column_privileges (resource $connection, [string $qualifier], [string $schema], [string $table-name], [string $column-
name])
DESCRIPTION
Returns a result set listing the columns and associated privileges for a table.
PARAMETERS
o $connection
- A valid connection to an IBM DB2, Cloudscape, or Apache Derby database.
o $qualifier
- A qualifier for DB2 databases running on OS/390 or z/OS servers. For other databases, pass NULL or an empty string.
o $schema
- The schema which contains the tables. To match all schemas, pass NULL or an empty string.
o $table-name
- The name of the table or view. To match all tables in the database, pass NULL or an empty string.
o $column-name
- The name of the column. To match all columns in the table, pass NULL or an empty string.
RETURN VALUES
Returns a statement resource with a result set containing rows describing the column privileges for columns matching the specified parame-
ters. The rows are composed of the following columns:
+-------------+---------------------------------------------------+
|Column name | |
| | |
| | Description |
| | |
+-------------+---------------------------------------------------+
| TABLE_CAT | |
| | |
| | Name of the catalog. The value is NULL if this |
| | table does not have catalogs. |
| | |
|TABLE_SCHEM | |
| | |
| | Name of the schema. |
| | |
| TABLE_NAME | |
| | |
| | Name of the table or view. |
| | |
|COLUMN_NAME | |
| | |
| | Name of the column. |
| | |
| GRANTOR | |
| | |
| | Authorization ID of the user who granted the |
| | privilege. |
| | |
| GRANTEE | |
| | |
| | Authorization ID of the user to whom the privi- |
| | lege was granted. |
| | |
| PRIVILEGE | |
| | |
| | The privilege for the column. |
| | |
|IS_GRANTABLE | |
| | |
| | Whether the GRANTEE is permitted to grant this |
| | privilege to other users. |
| | |
+-------------+---------------------------------------------------+
SEE ALSO db2_columns(3), db2_foreign_keys(3), db2_primary_keys(3), db2_procedure_columns(3), db2_procedures(3), db2_special_columns(3), db2_statis-
tics(3), db2_table_privileges(3), db2_tables(3).
PHP Documentation Group DB2_COLUMN_PRIVILEGES(3)