Sponsored Content
Top Forums Shell Programming and Scripting Append Second Row to First Row @ end in a file Post 302381374 by ichigo on Friday 18th of December 2009 03:01:53 AM
Old 12-18-2009
Code:
(g)awk 'ORS=(NR%2==0) ?"\n" :" "' file

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Changing the column for a row in a text file and adding another row

Hi, I want to write a shell script which increments a particular column in a row from a text file and then adds another row below the current row with the incremented value . For Eg . if the input file has a row : abc xyz lmn 89 lm nk o p I would like the script to create something like... (9 Replies)
Discussion started by: aYankeeFan
9 Replies

2. Shell Programming and Scripting

Get a group of line from different file and put them into one file row by row

hi guys, today i'm stuck in a new problem. the title explain more or less but a particular had been omitted. So i'm going to describe below the situation with an example. I have different html files and each of them have a consecutive lines group inside that i want to extract. example: ... (8 Replies)
Discussion started by: sbobotex
8 Replies

3. Shell Programming and Scripting

Subtracting each row from the first row in a single column file using awk

Hi Friends, I have a single column data like below. 1 2 3 4 5 I need the output like below. 0 1 2 3 4 where each row (including first row) subtracting from first row and the result should print below like the way shown in output file. Thanks Sid (11 Replies)
Discussion started by: ks_reddy
11 Replies

4. Shell Programming and Scripting

Append data to new row in CSV file every day

Hi All I will run the same script every day in corn and output should go to same CSV file but in different row with dates on it. Below is my example in attached format. Script i am using to collect switch port online DATE=`date '+%d-%m-%y'` for f in `cat... (1 Reply)
Discussion started by: ranjancom2000
1 Replies

5. UNIX for Dummies Questions & Answers

append column and row header to a file in awk script.

Hi! Is there a way to append column and row header to a file in awk script. For example if I have Jane F 39 manager Carlos M 40 system administrator Sam F 20 programmer and I want it to be # name gend age occup 1 Jane F 39 manager 2 Carlos M ... (4 Replies)
Discussion started by: FUTURE_EINSTEIN
4 Replies

6. Shell Programming and Scripting

Read row number from 1 file and print that row of second file

Hi. How can I read row number from one file and print that corresponding record present at that row in another file. eg file1 1 3 5 7 9 file2 11111 22222 33333 44444 55555 66666 77777 88888 99999 (3 Replies)
Discussion started by: Abhiraj Singh
3 Replies

7. Shell Programming and Scripting

Search row by row from one file to another file if match is found print few colums of file 2

this is the requirement list.txt table1 table2 table3 testfile.txt name#place#data#select * from table1 name2#place2#data2#select * from table 10 innerjoin table3 name2#place2#data2#select * from table 10 output name place table1 name2 place table3 i tried using awk (7 Replies)
Discussion started by: vamsekumar
7 Replies

8. Shell Programming and Scripting

Read line from the file and append it to each row

Hi All, We have a file in the following format: 0.010000 $ ITI 11 LV2 $ 40456211 $ 0.135000 $ ITI 11 LV1 $ 40512211 $ 1.215600 $ ITI 11 ITI3 $ 41406211 $ 24/05/2014 14:05:02 0.030000 $ ITI 11 LV2 $ 40456211 $ ... (3 Replies)
Discussion started by: gauravsinghal79
3 Replies

9. Shell Programming and Scripting

Split a file by start and end row.

I have a file which looks something as following, I would like to split to several files, The start and end of each file is 'FILE' and end with 'ASCII... ' . At the same time for each file in the first column add 100 and also second column add 100 the rest of the column as it is , see example of... (2 Replies)
Discussion started by: tk2000
2 Replies

10. Shell Programming and Scripting

Add Row from First Row (Split Row)

HI Guys, I have Below Input :- RepigA_hteis522 ReptCfiEtrBsCll_aofe MSL04_MSL2_A25_1A 0 9 MSL04_MSL2_A25_1B 0 9 MSL04_MSL2_A25_1C 0 9 RepigA ReptCfiEtrBsCll hteis522 aofe MSL04_MSL2_A25_1A 0 9 MSL04_MSL2_A25_1B 0 9 MSL04_MSL2_A25_1C 0 9 Split Data in two first row... (2 Replies)
Discussion started by: pareshkp
2 Replies
DBIx::Class::Helper::Row::ProxyResultSetMethod(3pm)	User Contributed Perl Documentation    DBIx::Class::Helper::Row::ProxyResultSetMethod(3pm)

NAME
DBIx::Class::Helper::Row::ProxyResultSetMethod - Efficiently reuse ResultSet methods from results VERSION
version 2.013002 SYNOPSIS
ResultSet: package MyApp::Schema::ResultSet::Foo; use base 'DBIx::Class::ResultSet'; __PACKAGE__->load_components(qw( Helper::ResultSet::CorrelateRelationship )); ...; sub with_friend_count { shift->search(undef, { '+columns' => { 'friend_count' => $self->correlate('friends')->count_rs->as_query, }, }) } Result: package MyApp::Schema::Result::Foo; use base 'DBIx::Class::Core'; __PACKAGE__->load_components(qw( Helper::Row::ProxyResultSetMethod )); __PACKAGE__->proxy_resultset_method('friend_count'); or with DBIx::Class::Candy: package MyApp::Schema::Result::Foo; use DBIx::Class::Candy -components => ['Helper::Row::ProxyResultSetMethod']; proxy_resultset_method 'friend_count'; Elsewhere: my $row = $foo_rs->first; say $row->friend_count . ' friends'; DESCRIPTION
This module makes reusing resultset methods from a result trivially easy. You should be using it. METHODS
proxy_resultset_method __PACKAGE__->proxy_resultset_method( $name => { slot => $slot, resultset_method => $rs_method }); "proxy_resultset_method"'s first argument is the name of the method to generate and is required. The other two arguments, $slot, and $resultset_method are optional. If unspecified $slot will default to $name and $resultset_method will default to "with_$name". $slot is the column that the data being retrieved is stored as in the ResultSet method being proxied to. $resultset_method is (duh) the ResultSet method being proxied to. CANDY EXPORTS
If used in conjunction with DBIx::Class::Candy this component will export: proxy_resultset_method DEDICATION
This module is dedicated to Ray Bradbury, who wrote Something Wicked This Way Comes, Dandelion Wine, and numerous short stories, plays, etc etc. Read this author's books. AUTHOR
Arthur Axel "fREW" Schmidt <frioux+cpan@gmail.com> COPYRIGHT AND LICENSE
This software is copyright (c) 2012 by Arthur Axel "fREW" Schmidt. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. perl v5.14.2 2012-06-18 DBIx::Class::Helper::Row::ProxyResultSetMethod(3pm)
All times are GMT -4. The time now is 02:01 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy