The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Command display output on console and simultaneously save the command and its output satimis UNIX for Dummies Questions & Answers 7 01-25-2009 08:27 PM
Paste Command does not align my output jplayermx Shell Programming and Scripting 4 09-05-2008 03:03 PM
how to redirect the output of a grep command to a file inside a shell script kripssmart Shell Programming and Scripting 11 06-19-2008 08:28 AM
how to get the output of a grep command to a file inside a shell script kripssmart UNIX for Dummies Questions & Answers 1 06-16-2008 04:12 PM
piping the output of find command to grep 435 Gavea UNIX for Dummies Questions & Answers 1 10-05-2006 05:48 PM

 
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 03-31-2009
ks_reddy ks_reddy is offline
Registered User
  
 

Join Date: Feb 2009
Posts: 26
How to feed the output from grep command to paste command

Hi friends,

I have few files in which the data in them neatly arranged into columns and rows.

I just want to paste the output of grep command operated on each file in side by side fashion.

If I use the paste | grep "keyword" *, then the result coming as
grep result from 1st file
grep result from 2nd file
..........................
grep result from nth file in the directory.

But what I need is
grep result from 1st file "\t" grep result from 2nd file "\t"......... grep result from nth file..


File1:
1 2 3 4
A B C D

File2:
A B C D
E F G H

paste | grep "A" file1 file2 gives the output like below
A B C D
A B C D
But the format I want is

A B C D A B C D

I hope everybody understood the problem description.

Thanks in advance....
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 09:46 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0