05-28-2014
please provide a small representative sample of the ACTUAL data and the desired output. A 10 record/line representative sample should be enough.
Please either code tags OR attach a file to a thread.
This User Gave Thanks to vgersh99 For This Post:
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi All,
I have a table with 10 columns. Some columns(2nd,4th,5th,7th,8th and 10th) are Not Null columns. I'll get a tab-delimited file and want to check col by col and generate seperate error code for each col eg:102 if 2nd col value is NULL and 104 if 4th col value is NULL so on... I am a... (7 Replies)
Discussion started by: Mandab
7 Replies
2. Shell Programming and Scripting
I have a text file names test2 with 3 columns as below . We have to retrieve the distinct values (not duplicate) from 2nd column and display. I have used the below command but giving some error.
NS3303 NS CRAFT LTD
NS3303 NS CHIRON VACCINES LTD
NS3303 NS ALLIED MEDICARE LTD
NS3303 NS... (16 Replies)
Discussion started by: shirdi
16 Replies
3. Shell Programming and Scripting
Hey guys, I have a column that consists of string and integer values without a distinctive deliminator, looking like this...
7ASA
14LAL
245FOO
656MOM
87577DAD
...
I want to split the column into two columns, one containing the numbers and one containing the text part.
edit: numbers... (3 Replies)
Discussion started by: origamisven
3 Replies
4. Shell Programming and Scripting
Hi all,
I have a file (say file.txt) which contains comma-separated rows. Each row has seven columns. Only column 4 or 5 (not both) can have empty values like "" in each line.
Sample lines
So, now i want all the rows that have column 4 as "" go in file1.txt and all the rows that have column... (8 Replies)
Discussion started by: jakSun8
8 Replies
5. Shell Programming and Scripting
Hi,
I have the following input file
32895901-d17f-414c-ac93-3e7e0f5ec240 AND @GDF_INPUT
73b129e1-1fa9-4c0d-b95b-4682e5389612 AUS @GDF_INPUT
40f82e88-d1ff-4ce2-9b8e-d827ddb39447 BEL @GDF_INPUT
36e9c3f1-042a-43a4-a80e-4a3bc2513d01 BGR @GDF_INPUT
I want to split column 3 into two columns:... (1 Reply)
Discussion started by: ramky79
1 Replies
6. UNIX for Dummies Questions & Answers
Hi !
input:
A|B|C|D
A|F|C|E
A|B|I|C
A|T|I|B
As the title of the thread says, I would need to get:
1|3|2|4
I tried different variants of this command, but I don't manage to obtain what I need:
gawk 'BEGIN{FS=OFS="|"}{for(i=1; i<=NF; i++) a++} END {for (b in a) print b}' input
... (2 Replies)
Discussion started by: beca123456
2 Replies
7. Shell Programming and Scripting
I have a lot of input files that have the following form:
Sample Cq Sample Cq Sample Cq Sample Cq Sample Cq
1WBIN 23.45 1WBIN 23.45 1CVSIN 23.96 1CVSIN 23.14 S1 31.37
1WBIN 23.53 1WBIN 23.53 1CVSIN 23.81 1CVSIN 23.24 S1 31.49
1WBIN 24.55 1WBIN 24.55 1CVSIN 23.86 1CVSIN 23.24 S1 31.74 ... (3 Replies)
Discussion started by: isildur1234
3 Replies
8. Shell Programming and Scripting
Hi All,
I have a pipe seperated file. I need to add the values in second and third columns with group by on first column.
MYFILE_28012012_1115|47|173.90
MYFILE_28012012_1115|4|0.00
MYFILE_28012012_1115|6|22.20
MYFILE_28012012_1116|47|173.90
MYFILE_28012012_1116|4|0.00... (3 Replies)
Discussion started by: angshuman
3 Replies
9. UNIX for Advanced & Expert Users
From googling and reading man pages I figured out this sorts the first column by numeric values.
sort -g -k 1,1
Why does the -n option not work? The man pages were a bit confusing.
And what if I want to sort the second column numerically? I haven't been able to figure that out. The file... (7 Replies)
Discussion started by: cokedude
7 Replies
10. UNIX for Beginners Questions & Answers
Hi All,
I am trying to replace a certain value from one place in a file . In the below file at position 35 I will have 8 I need to modify all 8 in that position to 7
I tried
awk '{gsub("8","7",$35)}1' infile > outfile ----> not working
sed -i 's/8/7'g' infile --- it is replacing all... (3 Replies)
Discussion started by: arunkumar_mca
3 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)