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 here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Include PERL script with in the unix shell script ganapati UNIX for Dummies Questions & Answers 1 04-29-2008 09:18 AM
here document to automate perl script that call script hogger84 Shell Programming and Scripting 3 10-22-2007 07:15 AM
Modify Perl script to work with txt - Permissions script joangopan Shell Programming and Scripting 1 09-12-2007 08:38 PM
Calling a perl script from a perl script new2ss Shell Programming and Scripting 3 02-06-2007 07:17 PM
Perl: Run perl script in the current process vino Shell Programming and Scripting 10 12-09-2005 06:45 AM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 03-09-2006
Registered User
 

Join Date: Feb 2006
Posts: 8
Stumble this Post!
Help with Perl script

I have a file with column seperated data:

Column1_0 Column2
Column1_0 Column2
Column1_1 Column2
Column1_3 Column2

I need to use the data in this file to feed into a command which will use not only the column data as input but also the digit after the underscore in the first column.

Command would look like this:

command -arguments <Column1/_0> <Column2>
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 03-09-2006
Registered User
 

Join Date: Feb 2006
Posts: 8
Stumble this Post!
Oh well, I guess I'll answer my own question:

cat file.txt | perl -pe 's/(.*?)\s+(.*?)$/command \-$2 $1/' | perl -pe 's/_/\//'
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 05:32 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0