Returning specific columns upon matching


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Returning specific columns upon matching
# 8  
Old 09-19-2014
Code:
sub(/\r$/, "")

(remove one \r at the end of the line)
is faster and more precise than
Code:
gsub(/\r/, "")

(remove all \r in the line)
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Matching first 2 columns..

Hello All, I want to make a file which will have primarily lines of file2 but when first 2 fields matches with the file1 it should have those lines of file1.. example is as below.. file1 a;b;1 c;d f;e t;r;5 file2 b;g a;b c;d v;b f;e t;r (2 Replies)
Discussion started by: ailnilanjan
2 Replies

2. UNIX for Dummies Questions & Answers

Printing lines with specific strings at specific columns

Hi I have a file which is tab-delimited. Now, I'd like to print the lines which have "chr6" string in both first and second columns. Could anybody help? (3 Replies)
Discussion started by: a_bahreini
3 Replies

3. Shell Programming and Scripting

Can't figure out how to find specific characters in specific columns

I am trying to find a specific set of characters in a long file. I only want to find the characters in column 265 for 4 bytes. Is there a search for that? I tried cut but couldn't get it to work. Ex. I want to find '9999' in column 265 for 4 bytes. If it is in there, I want it to print... (12 Replies)
Discussion started by: Drenhead
12 Replies

4. Shell Programming and Scripting

Print columns matching to specific values

Hello Friends, I have a CDR file and i need to print out 2 columns with their field position which matches to some constant values, a part of input file CZ=1|CZA=1|DIAL=415483420001|EE=13|ESF=1|ET=|FF=0|9|MNC=99|MNP=9041|MTC=0|NID=2|NOA=international|ON=1| OutPut ... (3 Replies)
Discussion started by: EAGL€
3 Replies

5. Shell Programming and Scripting

Common records after matching on different columns

Hi, I have the following files. cat 1.txt cat 2.txt output.txt The logic is as follows.... (10 Replies)
Discussion started by: jacobs.smith
10 Replies

6. UNIX for Dummies Questions & Answers

matching columns

Hello experts, I have this problem, I need to match values based on two files, this is what I have: file1 1.1 1.2 1.3 5.5 1.4 1.5 1.6 file2 1 a 2 B 3 C 4 D 5 z (7 Replies)
Discussion started by: Gery
7 Replies

7. UNIX for Dummies Questions & Answers

Matching corresponding columns in two different files

Hi to all, I have two separated files: FILE1 "V1" "V2" "V3" Mary James Nicole Robert Francisco Sophie Nancy Antony Matt Josephine Louise Rose Mark Simon Charles FILE2 "V1" "V2" "V3"... (2 Replies)
Discussion started by: eleonoral
2 Replies

8. Shell Programming and Scripting

matching columns from two files

Hey, I have two files that have exactly the same format. They are both tab-delimited and contain 12 columns. However the # of rows vary. What I want to do is match columns # 5,6 and 7 between the two files. If they do match exactly (based on numbers) then I want the whole row from file 2 to... (1 Reply)
Discussion started by: phil_heath
1 Replies

9. UNIX for Dummies Questions & Answers

Searching partial columns and returning maximum as output

Hello, I am just getting starting with awk and wondering if anyone could help with the following problem. I have a large file of data, 50,000 rows x 6 columns. I would like to search in blocks of 500 rows for a maximum value in a specific column and compile an output file that prints the... (0 Replies)
Discussion started by: xb_analysis
0 Replies

10. Shell Programming and Scripting

Returning filename and matching lines

What I'm trying to do is to search through a list of files, and output the filename, followed by the lines that matched the pattern. I'm matching the string "letters.moreletters" in any one of searched files, and the output I'm trying to get is: program_1.txt 10 dsdsd sdsd dsd... (2 Replies)
Discussion started by: smb_uk
2 Replies
Login or Register to Ask a Question
DB2_COLUMN_PRIVILEGES(3)						 1						  DB2_COLUMN_PRIVILEGES(3)

db2_column_privileges - Returns a result set listing the columns and associated privileges for a table

SYNOPSIS
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)