Sponsored Content
Top Forums Shell Programming and Scripting awk : Remove column1 and last column in a line Post 302519808 by kumaran_5555 on Thursday 5th of May 2011 05:59:04 AM
Old 05-05-2011
Code:
awk -F' ' '{printf "processing "; for(i=2;i<NF;i++){ printf "%s ",$i}; print "..."}' file_name

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

remove new line characters from a partcular column data

Dear friends, I have a pipe delimited file having 5 columns. However the column no-3 is having extra new line characters as the data owing to owing , I am having issues. Ideally my file should have only newline termination at the end of each record and not within column data of any of... (1 Reply)
Discussion started by: sureshg_sampat
1 Replies

2. Shell Programming and Scripting

awk remove column with conditions?

Folks: I have a file which has 3 columns. Using awk I want to remove rows from column 3 (Col3 <> A) where it is not equal to A. All columns are seperated by "|". Col1|Col2|Col3|Col4 1 | 2 | A | 4 2 | 3 | A | 5 3 | 4 | B | 6 4 | 5 | A | 7 5 | 6 | ... (3 Replies)
Discussion started by: pr2003
3 Replies

3. Shell Programming and Scripting

awk - replacing stings in file1 with column1 in file2

Hello, I've never used awk before, but from what I've read, it will best suit what I'm trying to do. I have 2 files. I need to replace strings in file1 with the first column of a matching string in file2. Below are examples: File1: random-string1 1112 1232 3213 2131 random-string2... (7 Replies)
Discussion started by: upstate_boy
7 Replies

4. Shell Programming and Scripting

Remove line feed from csv file column

Hi All, My requirement is to remove line (3 Replies)
Discussion started by: r_t_1601
3 Replies

5. Shell Programming and Scripting

Remove line feed from csv file column

Hi All, i have a csv file . In the 7th column i have data that has line feed in it. Requirement is to remove the line feed from the 7th column whenever it appears There are 11 columns in the file C1,C2,C3,C4,C5,C6,C7,C8,C9,C10,C11 The value in C7 contains line feed ( Alt + Enter ),... (2 Replies)
Discussion started by: r_t_1601
2 Replies

6. Shell Programming and Scripting

How to remove a line if column 1 does not contain any value?

Input File science maths tom 2 3 peter 5 rodger 5 7 Desired Ouput science maths tom 2 3 rodger 5 7 Here Peter does not have any value for column Science, how can we delete Peter's row. assuming this is abc.txt file; and am using bash... (8 Replies)
Discussion started by: vishalgoyal
8 Replies

7. Shell Programming and Scripting

Remove character from a column in each line

Hi, I am a newbie to shell scripting (.sh). Please guide me on how to do the below issue. My input file has below data. I want to remove $ sysmbol from the fourth column of each line. (ie, between 4th and 5th pipe symbol) ABC25160|51497|06/02/2010|$32,192.07|MARK|$100|A... (3 Replies)
Discussion started by: rsreejithmenon
3 Replies

8. Shell Programming and Scripting

How to remove a line based on contents of the first column?

Good day all. Using basic UNIX/Linux tools, how would you delete a line based on a character found in column 1? For example, if the CITY name contains an 'a' or 'A', delete the line: New York City; New York Los Angeles; California Chicago; Illinois Houston; Texas Philadelphia;... (3 Replies)
Discussion started by: BRH
3 Replies

9. Shell Programming and Scripting

How can I remove first column with awk?

cat input.txt a x b y c z Expected output x y z (11 Replies)
Discussion started by: cola
11 Replies

10. Shell Programming and Scripting

CSV File:Filter duplicate records from column1 & another column having unique record

Hi Experts, I have csv file with 30, 40 columns Pasting just 2 column for problem description. Need to print error if below combination is not present in file check for column-1 (DocumentNumber) and filter columns where value in DocumentNumber field is same. For all such rows, the field... (7 Replies)
Discussion started by: as7951
7 Replies
DBIx::Class::Schema::Loader::RelBuilder(3pm)		User Contributed Perl Documentation	      DBIx::Class::Schema::Loader::RelBuilder(3pm)

NAME
DBIx::Class::Schema::Loader::RelBuilder - Builds relationships for DBIx::Class::Schema::Loader SYNOPSIS
See DBIx::Class::Schema::Loader and DBIx::Class::Schema::Loader::Base. DESCRIPTION
This class builds relationships for DBIx::Class::Schema::Loader. This is module is not (yet) for external use. METHODS
new Arguments: $loader object generate_code Arguments: [ [ local_moniker1 (scalar), fk_info1 (arrayref), uniq_info1 (arrayref) ] [ local_moniker2 (scalar), fk_info2 (arrayref), uniq_info2 (arrayref) ] ... ] This generates the code for the relationships of each table. "local_moniker" is the moniker name of the table which had the REFERENCES statements. The fk_info arrayref's contents should take the form: [ { local_table => 'some_table', local_moniker => 'SomeTable', local_columns => [ 'col2', 'col3' ], remote_table => 'another_table_moniker', remote_moniker => 'AnotherTableMoniker', remote_columns => [ 'col5', 'col7' ], }, { local_table => 'some_other_table', local_moniker => 'SomeOtherTable', local_columns => [ 'col1', 'col4' ], remote_table => 'yet_another_table_moniker', remote_moniker => 'YetAnotherTableMoniker', remote_columns => [ 'col1', 'col2' ], }, # ... ], The uniq_info arrayref's contents should take the form: [ [ uniq_constraint_name => [ 'col1', 'col2' ], ], [ another_uniq_constraint_name => [ 'col1', 'col2' ], ], ], This method will return the generated relationships as a hashref keyed on the class names. The values are arrayrefs of hashes containing method name and arguments, like so: { 'Some::Source::Class' => [ { method => 'belongs_to', arguments => [ 'col1', 'Another::Source::Class' ], { method => 'has_many', arguments => [ 'anothers', 'Yet::Another::Source::Class', 'col15' ], ], 'Another::Source::Class' => [ # ... ], # ... } AUTHOR
See "AUTHOR" in DBIx::Class::Schema::Loader and "CONTRIBUTORS" in DBIx::Class::Schema::Loader. LICENSE
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.14.2 2012-06-08 DBIx::Class::Schema::Loader::RelBuilder(3pm)
All times are GMT -4. The time now is 06:15 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy