The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

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.

Closed Thread
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
  #1 (permalink)  
Old 02-25-2009
gingburg gingburg is offline VIP Member  
Supporter
  
 

Join Date: Oct 2008
Posts: 41
Awk Question

say i am using a command:

awk '/EUMP2/ {print $6}' File1 >> File2

which should append to file2, correct.

How do I get it to append but first add a space.

Thank you
  #2 (permalink)  
Old 02-25-2009
quirkasaurus's Avatar
quirkasaurus quirkasaurus is offline
Registered User
  
 

Join Date: Jan 2009
Location: canton, michigan
Posts: 373
Code:
awk '/EUMP2/ {print " ", $6}' File1 >> File2
  #3 (permalink)  
Old 02-25-2009
quirkasaurus's Avatar
quirkasaurus quirkasaurus is offline
Registered User
  
 

Join Date: Jan 2009
Location: canton, michigan
Posts: 373
or....

Code:
echo " " >> File2
awk '/EUMP2/ {print $6}' File1 >> File2
  #4 (permalink)  
Old 02-25-2009
quirkasaurus's Avatar
quirkasaurus quirkasaurus is offline
Registered User
  
 

Join Date: Jan 2009
Location: canton, michigan
Posts: 373
or:

Code:
awk 'BEGIN{
  printf( " " );
  }
/EUMP2/ {print $6}' File1 >> File2
... depending upon what you really meant. . .. or wanted to do....
Closed Thread

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 12:34 PM.


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