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.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
How to grep / zgrep to output ONLY the matching filename and line number? vvaidyan UNIX for Dummies Questions & Answers 3 03-12-2008 05:33 PM
Accepting filename as command line param and writing to it silas.john Shell Programming and Scripting 9 02-06-2008 09:26 AM
Get Filename and Line Number using grep ceemh3 UNIX for Dummies Questions & Answers 4 09-17-2007 11:35 AM
Grabing Date from filename and adding to the end of each line in the file. rkumar28 Shell Programming and Scripting 1 05-01-2007 09:25 PM
help on deleting file/filename apalex UNIX for Dummies Questions & Answers 4 06-27-2001 10:31 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 05-08-2007
tmikahan tmikahan is offline
Registered User
  
 

Join Date: Jan 2004
Location: Finland
Posts: 4
How to add filename to the end of each line in file

Hi,

I'm reading data from comma separated files to DB. Now there is a need to have the name of the input file in each row of that file. How can I do this in unix script?

Example:

$cat file1
value11,value12, value,13
value21,value22, value,23
value31,value32, value,33

And the result should be:

$cat file1
value11,value12, value,13,file1
value21,value22, value,23,file1
value31,value32, value,33,file1

Thanks in advance,
-M-
 

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 06:36 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