11-04-2012
How can I modify the code if the files have 20 columns instead of 2 columns? The first column of the files still match perfectly. I want to print out the rows in which there is a perfect match between every single element between the two files?
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hello,
I have two files:
file1
1
2
3
4
5
file2
"a","b",,,,,"c","1",.....
"s","d",,,,,"s","1",.....
"a","c",,,,,"d","1",....
"f","v",,,,,,"f","2",.....
etc
I have to read "1" from file1 and grab all records in file2 (say column 6 in file2 is "1") until the column changes its value (... (6 Replies)
Discussion started by: i.scientist
6 Replies
2. UNIX for Dummies Questions & Answers
Hello all,
I always found help for my problems using the search option, but this time my request is too specific. I have two files that I want to compare. File1 is the index and File2 contains the data:
File1:
chr1 protein_coding exon 500 600 . + . gene_id "20532";... (0 Replies)
Discussion started by: DerSeb
0 Replies
3. UNIX for Dummies Questions & Answers
Hi
I am writing a script to run a loop through a directory and run a diff on each file against my test file.
I then want to time how long each file to process (not sure how time works), as well as how long all the files took as a whole to process.
Here is my code
#!/bin/bash
#Old... (1 Reply)
Discussion started by: ladyAnne
1 Replies
4. Shell Programming and Scripting
Hi guys,
I'm rather new at using UNIX based systems, and when it comes to scripting etc I'm even newer.
I have two files which i need to compare.
file1: (some random ID's)
451245
451288
136588
784522
file2: (random ID's + e-mail assigned to ID)
123888 xc@xc.com
451245 ... (21 Replies)
Discussion started by: spirm8
21 Replies
5. UNIX for Dummies Questions & Answers
I have two text files where the first three columns are exactly the same. I want to compare the fourth column of the text files and if the values are different, print that row into a new output file. How do I go about doing that?
File 1:
100 rs3794811 0.01 0.3434
100 rs8066551 0.01... (8 Replies)
Discussion started by: evelibertine
8 Replies
6. Shell Programming and Scripting
Hi
Am trying to compare the values of two files..
One is a big file that has many values and the other is a small file..
The big file has all values present in small file..
# cat SmallFile
4456602 22347881
7471282 15859891
8257690 21954701
7078068 18219229
2883826 6094959
100000
... (3 Replies)
Discussion started by: Priya Amaresh
3 Replies
7. Shell Programming and Scripting
I need to develop a script where I will take two date arguments as parameter date1 and date2 which will in format YYYYMM.
Below is the input file say sample.txt.
sample.txt will have certain blocks starting with P1.
Each block will have a value 118,1:TIMESTAMP.
I need to compare the... (7 Replies)
Discussion started by: garvit184
7 Replies
8. Shell Programming and Scripting
First I'd like to apologize if I opened a thread which is already open somewhere.
I did a bit of searching but could quite find what I was looking for, so I will try to explaing what I need.
I'm writing a script on our server, got to a point where I have two files with results. Example:
File1... (6 Replies)
Discussion started by: mitabrev83
6 Replies
9. Shell Programming and Scripting
I have two files. One is consisting of one line, with data separated by spaces and each number appearing only once.
The other is consisting of one column and multiple lines which can have some numbers appearing more than once.
It looks something like this:
file 1:
20 700 15 30
file2:
10... (10 Replies)
Discussion started by: maya3
10 Replies
10. Shell Programming and Scripting
Hello all, First post here. I did not notice a previous post to help me down the right path. I am looking to compare a column in a CSV file against another file (which is not a column match one for one) but more or less when a match is made, I would like to append a third column that contains a... (17 Replies)
Discussion started by: dis0wned
17 Replies
LEARN ABOUT PHP
db2_columns
DB2_COLUMNS(3) 1 DB2_COLUMNS(3)
db2_columns - Returns a result set listing the columns and associated metadata for a table
SYNOPSIS
resource db2_columns (resource $connection, [string $qualifier], [string $schema], [string $table-name], [string $column-name])
DESCRIPTION
Returns a result set listing the columns and associated metadata 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 '%'.
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 columns matching the specified parameters. The rows are com-
posed 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. |
| | |
| DATA_TYPE | |
| | |
| | The SQL data type for the column represented as |
| | an integer value. |
| | |
| TYPE_NAME | |
| | |
| | A string representing the data type for the col- |
| | umn. |
| | |
| COLUMN_SIZE | |
| | |
| | An integer value representing the size of the |
| | column. |
| | |
| BUFFER_LENGTH | |
| | |
| | Maximum number of bytes necessary to store data |
| | from this column. |
| | |
| DECIMAL_DIGITS | |
| | |
| | The scale of the column, or NULL where scale is |
| | not applicable. |
| | |
| NUM_PREC_RADIX | |
| | |
| | An integer value of either 10 (representing an |
| | exact numeric data type), 2 (representing an |
| | approximate numeric data type), or NULL (repre- |
| | senting a data type for which radix is not appli- |
| | cable). |
| | |
| NULLABLE | |
| | |
| | An integer value representing whether the column |
| | is nullable or not. |
| | |
| REMARKS | |
| | |
| | Description of the column. |
| | |
| COLUMN_DEF | |
| | |
| | Default value for the column. |
| | |
| SQL_DATA_TYPE | |
| | |
| | An integer value representing the size of the |
| | column. |
| | |
|SQL_DATETIME_SUB | |
| | |
| | Returns an integer value representing a datetime |
| | subtype code, or NULL for SQL data types to which |
| | this does not apply. |
| | |
|CHAR_OCTET_LENGTH | |
| | |
| | Maximum length in octets for a character data |
| | type column, which matches COLUMN_SIZE for sin- |
| | gle-byte character set data, or NULL for non- |
| | character data types. |
| | |
|ORDINAL_POSITION | |
| | |
| | The 1-indexed position of the column in the ta- |
| | ble. |
| | |
| IS_NULLABLE | |
| | |
| | A string value where 'YES' means that the column |
| | is nullable and 'NO' means that the column is not |
| | nullable. |
| | |
+------------------+---------------------------------------------------+
SEE ALSO
db2_column_privileges(3), db2_foreign_keys(3), db2_primary_keys(3), db2_procedure_columns(3), db2_procedures(3), db2_special_columns(3),
db2_statistics(3), db2_table_privileges(3), db2_tables(3).
PHP Documentation Group DB2_COLUMNS(3)