Sponsored Content
Top Forums Shell Programming and Scripting Need to extract data from Column having variable length column Post 302593995 by balajesuri on Monday 30th of January 2012 06:24:47 AM
Old 01-30-2012
I don't understand. What is the exact output you're looking for?
Code:
echo "0000          1000     10202012" | awk '{print $1}'

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Extract column data from File

I have a file containing the lines similar to the following entries: File1.txt: ..... -rw-r--r-- 1 root staff 4110 Aug 7 17:02 XXX_OrderNum1_date1_time1.txt -rw-r--r-- 1 root staff 4110 Aug 7 17:02 XXX_OrderNum2_date2_time1.txt -rw-r--r-- 1 root staff ... (3 Replies)
Discussion started by: sudheshnaiyer
3 Replies

2. Shell Programming and Scripting

Comparing column of variable length anf fixed width file

Hi, I have two input files. File1: ID Name Place 1-234~name1~Newyork 1-34~name2~Boston 1-2345~name3~Hungary File1 is a variable length file where each column is seperated by delimitter "~". File2: ID Country 1-34<<11 SPACES>>USA<<7 spaces>> 1-234<<10 SPACES>>UK<<8... (5 Replies)
Discussion started by: manneni prakash
5 Replies

3. Shell Programming and Scripting

how to extract a data from a column?

Hi All, Consider the below column, say this is the 4th column in a file PROV_STATS:::919900546978::Nokia 6600 PROV_STATS:::919900546978::Nokia 6600 PROV_STATS:::919900546978::Nokia 6600 I wanted to extract only 919900546978 from the 4 th cloumn using unix scripting? Kindly help (8 Replies)
Discussion started by: Balaji Sukumara
8 Replies

4. Shell Programming and Scripting

Extract data based on match against one column data from a long list data

My input file: data_5 Ali 422 2.00E-45 102/253 140/253 24 data_3 Abu 202 60.00E-45 12/23 140/23 28 data_1 Ahmad 256 7.00E-45 120/235 140/235 22 data_4 Aman 365 8.00E-45 15/65 140/65 20 data_10 Jones 869 9.00E-45 65/253 140/253 18... (12 Replies)
Discussion started by: patrick87
12 Replies

5. UNIX for Dummies Questions & Answers

Extract alphahumeric data from a column

Hi Unix Gurus, I am newbie to UNIX. I have a file test.txt with the follwing data aa90558 bb72962 cc08342 xy112233 yz25341 aa372099 cc34590231 bb880011 testfil Whatisit00 1234556 testfile2test I want to output only the items with two alpha followed by 5 numeric (ex aa90558 or... (2 Replies)
Discussion started by: SalM
2 Replies

6. Shell Programming and Scripting

for each different entry in column 1 extract maximum values from column 2 in unix/awk

Hello, I have 2 columns (1st column has multiple entries but the corresponding values in the column 2 may be the same or different.) however I want to extract unique values for each entry in column 1 by assigning the max value from column 2 SDF4 -0.211654 SDF4 0.978068 ... (1 Reply)
Discussion started by: Diya123
1 Replies

7. Shell Programming and Scripting

Compare 2 files and match column data and align data from 3 column

Hello experts, Please help me in achieving this in an easier way possible. I have 2 csv files with following data: File1 08/23/2012 12:35:47,JOB_5330 08/23/2012 12:35:47,JOB_5330 08/23/2012 12:36:09,JOB_5340 08/23/2012 12:36:14,JOB_5340 08/23/2012 12:36:22,JOB_5350 08/23/2012... (5 Replies)
Discussion started by: asnandhakumar
5 Replies

8. UNIX for Dummies Questions & Answers

Extract column data

I have a file which extracts data from an HTML file For Eg HTML file contains: New York;ABC;145;Yes;YES;No New York;BCD;113;Yes;YES;No New York;NAS;63;Yes;YES;No ------------------------ London-48;CBT;16;Yes;YES;No London-48;CME;17;Yes;YES;No London-48;EUR;52;Yes;YES;No... (3 Replies)
Discussion started by: newkid.7955
3 Replies

9. Shell Programming and Scripting

awk to extract value from column using variable

I am having trouble extracting the value in the columns declared in a variable. I have tried several different variation of awk but both give me the column number and not the actual value of that column. Any suggestions? Neither of the "extract" variables below are performing as desired ... (5 Replies)
Discussion started by: ncwxpanther
5 Replies

10. Shell Programming and Scripting

Get extract and replace column with link in a column where it exists

hi i have sample data a,b,c,d,e,g h http://mysite.xyx z,b,d,f,e,s t http://123124# a,b,c,i,m,nothing d,i,j,e,w,nothing output expected is a,b,c,d,e,http://mysite.xyx z,b,d,f,e,http://123124# a,b,c,i,m,nothing d,i,j,e,w,nothing i can get only links using grep -o 'http.*' i... (8 Replies)
Discussion started by: zozoo
8 Replies
DBSchema::Column(3pm)					User Contributed Perl Documentation				     DBSchema::Column(3pm)

NAME
DBIx::DBSchema::Column - Column objects SYNOPSIS
use DBIx::DBSchema::Column; #named params with a hashref (preferred) $column = new DBIx::DBSchema::Column ( { 'name' => 'column_name', 'type' => 'varchar' 'null' => 'NOT NULL', 'length' => 64, 'default' => '', 'local' => '', } ); #list $column = new DBIx::DBSchema::Column ( $name, $sql_type, $nullability, $length, $default, $local ); $name = $column->name; $column->name( 'name' ); $sql_type = $column->type; $column->type( 'sql_type' ); $null = $column->null; $column->null( 'NULL' ); $column->null( 'NOT NULL' ); $column->null( '' ); $length = $column->length; $column->length( '10' ); $column->length( '8,2' ); $default = $column->default; $column->default( 'Roo' ); $sql_line = $column->line; $sql_line = $column->line($datasrc); $sql_add_column = $column->sql_add_column; $sql_add_column = $column->sql_add_column($datasrc); DESCRIPTION
DBIx::DBSchema::Column objects represent columns in tables (see DBIx::DBSchema::Table). METHODS
new HASHREF new [ name [ , type [ , null [ , length [ , default [ , local ] ] ] ] ] ] Creates a new DBIx::DBSchema::Column object. Takes a hashref of named parameters, or a list. name is the name of the column. type is the SQL data type. null is the nullability of the column (intrepreted using Perl's rules for truth, with one exception: `NOT NULL' is false). length is the SQL length of the column. default is the default value of the column. local is reserved for database-specific information. Note: If you pass a scalar reference as the default rather than a scalar value, it will be dereferenced and quoting will be forced off. This can be used to pass SQL functions such as "now()" or explicit empty strings as '' as defaults. name [ NAME ] Returns or sets the column name. type [ TYPE ] Returns or sets the column type. null [ NULL ] Returns or sets the column null flag (the empty string is equivalent to `NOT NULL') length [ LENGTH ] Returns or sets the column length. default [ LOCAL ] Returns or sets the default value. local [ LOCAL ] Returns or sets the database-specific field. table_obj [ TABLE_OBJ ] Returns or sets the table object (see DBIx::DBSchema::Table). Typically set internally when a column object is added to a table object. table_name Returns the table name, or the empty string if this column has not yet been assigned to a table. line [ DATABASE_HANDLE | DATA_SOURCE [ USERNAME PASSWORD [ ATTR ] ] ] Returns an SQL column definition. The data source can be specified by passing an open DBI database handle, or by passing the DBI data source name, username and password. Although the username and password are optional, it is best to call this method with a database handle or data source including a valid username and password - a DBI connection will be opened and the quoting and type mapping will be more reliable. If passed a DBI data source (or handle) such as `DBI:mysql:database' or `DBI:Pg:dbname=database', will use syntax specific to that database engine. Currently supported databases are MySQL and PostgreSQL. Non-standard syntax for other engines (if applicable) may also be supported in the future. quoted_default DATABASE_HANDLE Returns this column's default value quoted for the database. sql_add_column [ DBH ] Returns a list of SQL statements to add this column to an existing table. (To create a new table, see "sql_create_table" in DBIx::DBSchema::Table instead.) The data source can be specified by passing an open DBI database handle, or by passing the DBI data source name, username and password. Although the username and password are optional, it is best to call this method with a database handle or data source including a valid username and password - a DBI connection will be opened and the quoting and type mapping will be more reliable. If passed a DBI data source (or handle) such as `DBI:Pg:dbname=database', will use PostgreSQL-specific syntax. Non-standard syntax for other engines (if applicable) may also be supported in the future. sql_alter_column PROTOTYPE_COLUMN [ DATABASE_HANDLE | DATA_SOURCE [ USERNAME PASSWORD [ ATTR ] ] ] Returns a list of SQL statements to alter this column so that it is identical to the provided prototype column, also a DBIx::DBSchema::Column object. Optionally, the data source can be specified by passing an open DBI database handle, or by passing the DBI data source name, username and password. If passed a DBI data source (or handle) such as `DBI:Pg:dbname=database', will use PostgreSQL-specific syntax. Non-standard syntax for other engines (if applicable) may also be supported in the future. If not passed a data source (or handle), or if there is no driver for the specified database, will attempt to use generic SQL syntax. sql_drop_column [ DBH ] Returns a list of SQL statements to drop this column from an existing table. The optional database handle or DBI data source/username/password is not yet used. AUTHOR
Ivan Kohler <ivan-dbix-dbschema@420.am> COPYRIGHT
Copyright (c) 2000-2006 Ivan Kohler Copyright (c) 2007-2010 Freeside Internet Services, Inc. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. BUGS
The new() method should warn that "Old-style $class creation without named parameters is deprecated!" Better documentation is needed for sql_add_column sql_alter_column() has database-specific foo that should be abstracted info DBIx::DBSchema::DBD::Pg nullify_default option should be documented SEE ALSO
DBIx::DBSchema::Table, DBIx::DBSchema, DBIx::DBSchema::DBD, DBI perl v5.14.2 2010-03-26 DBSchema::Column(3pm)
All times are GMT -4. The time now is 11:52 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy