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
appending two string is not working krishna9 Shell Programming and Scripting 11 05-19-2008 05:31 AM
Appending a string to all files in a directory ragavhere Shell Programming and Scripting 1 04-28-2008 07:31 AM
Sed appending string using for loop? cstovall Shell Programming and Scripting 2 01-28-2007 09:30 PM
appending string to text file based on search string malaymaru Shell Programming and Scripting 1 06-09-2006 09:53 AM
Appending string to xml file using "sed" nir_s Shell Programming and Scripting 2 05-09-2006 04:54 AM

 
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 04-02-2008
satyam_sat satyam_sat is offline
Registered User
  
 

Join Date: Mar 2008
Posts: 20
Appending 'string' to file as first column.

Hi , I have the below file with 6 columns.I want to append 'File1' as the 1 column to the file. i have the sample code .It is not working . can u please correct this or make new one .....

Code:
awk 'print {'File1',$1,$2,$3,$4,$5,$6}' Source_File> Result_File

Source_File:

Code:
E100,0,5/29/1993,0,E001,E000
E102,0,1/23/1994,0,E001,E003
E104,0,6/4/1994,0,E001,E003
E105,0,7/30/1993,0,E001,E003

Result_File :

Code:
File1,E100,0,5/29/1993,0,E001,E000
File1,E102,0,1/23/1994,0,E001,E003
File1,E104,0,6/4/1994,0,E001,E003
File1,E105,0,7/30/1993,0,E001,E003

Please help me .....

Last edited by satyam_sat; 04-02-2008 at 04:43 AM.. Reason: added code tags
 

Bookmarks

Tags
awk, sed

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:31 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