Sponsored Content
Top Forums UNIX for Advanced & Expert Users find columns with whitespace as field seperator? Post 302110484 by tkbharani on Tuesday 13th of March 2007 07:58:59 AM
Old 03-13-2007
this will not work...as one column may also contain null(space) value..
the null value will be considered as seperator.

Eg:Inputfile
3445 56 67
23 2 45
07 06


output of 3rd line 2nd column must be null(empty)
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Awk Field Seperator Help

I wrote a script on HPUX 11.11 to turn a Decimal subnet mask (255.255.254.0) to hex 0xfffffe00 (subset of a bigger script). It works great on the HPUX systems but on the freebsd box the awk is not seperating the fields properly. I tried to google for a solution and seaching these forums i am just... (3 Replies)
Discussion started by: insania
3 Replies

2. Shell Programming and Scripting

regexp to print after a field seperator

Hi, How do i Print anything after a ':' Ex : file1: 1235131(rs32553) I want to print out "1235131(rs32553)" how do i do it. I know we can do this using awk but looking for the right syntax. Any help appreciated. Thanks, Ram (7 Replies)
Discussion started by: ramky79
7 Replies

3. Shell Programming and Scripting

How to change field seperator

Hi Please help me out with this problem: I want to have a script that would change the nth field seperator in a line into something else. like a,d,4,2,97,8,9 into a,d,4,2,97/8/9 Thanks (2 Replies)
Discussion started by: onthetopo
2 Replies

4. Shell Programming and Scripting

Printing value with no obvious field seperator

Hi all, Can anybody think of a way to do this? I have a file with content like the following: F_TOP_PARAM_VALUEF_TOP_SOURCEF_TOP_DEL_NOTIFICATIONF_DEST_ADDRF_TOP_DEL_TYPE What I want to do is print out the value in the square brackets after F_TOP_SOURCE. So in this case I'd like to print... (4 Replies)
Discussion started by: Donkey25
4 Replies

5. Shell Programming and Scripting

Add a field seperator in a file.

"355"|""|"NJ"|"A0A 1W0"|"V"|""|""|""|"N" I've the above sample data seperated with pipe delimeter and in the file I want to replace a space with "|" to the 4th field so the result would be like below. So it would change from 9 fields to 10 fields. "355"|""|"NJ"|"A0A"|"1W0"|"V"|""|""|""|"N" ... (3 Replies)
Discussion started by: rudoraj
3 Replies

6. Shell Programming and Scripting

field seperator question (awk script)

Is there a way I could use different a different field seperator for different parts of the body? kinda like {FS = ":"} FILENAME == "products"{ price = $3 if(numprods < $1-100) numprods = $1-100 } {FS = "/"}{} FILENAME == "associates"{ associateid... (5 Replies)
Discussion started by: angermanaged
5 Replies

7. Shell Programming and Scripting

find grep whitespace problem

Hey guys iv written a basic function to ask for input location to find then grep a certain string in the file at the location of the find. For some reason it finds the file with the certain string it however it says directory not found on each string before the whitespace eg enter location to... (5 Replies)
Discussion started by: musicmancanora4
5 Replies

8. Shell Programming and Scripting

How to match (whitespace digits whitespace) sequence?

Hi Following is an example line. echo "192.22.22.22 \"33dffwef\" 200 300 dsdsd" | sed "s:\(\ *\ \):\1:" I want it's output to be 200 However this is not the case. Can you tell me how to do it? I don't want to use AWK for this. Secondly, how can i fetch just 300? Should I use "\2"... (3 Replies)
Discussion started by: shahanali
3 Replies

9. Shell Programming and Scripting

awk to ignore whitespace in field

The awk below executes and update the desired field in my first awk. However, the white space between nonsynonymous SNV in $9 is being split into tabs and my attempt to correct this does not update the field unless it is removed. I am not sure what I am doing wrong? Thank you :). file1 ... (4 Replies)
Discussion started by: cmccabe
4 Replies

10. UNIX for Beginners Questions & Answers

Field seperator with awk

Hi, input data format: echo ' <APPLICATION="APPLSG" SUB_APPLICATION="DLY" JOBNAME="DPL_BN_RE_CCMS_SA" CMDLINE="run_job.ksh %%PARAM1 %%PARAM2" TASKTYPE="Command" />' expected format: "APPLSG", "DLY", "DPL_BN_RE_CCMS_SA", "run_job.ksh %%PARAM1 %%PARAM2" my command: echo ' ... (2 Replies)
Discussion started by: JSKOBS
2 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 04:29 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy