The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com



UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
AWK or KSH : Sort, Group and extract from 3 files Matrix2682 Shell Programming and Scripting 3 08-21-2009 06:05 PM
Find all files with group read OR group write OR user write permission shunter63 Shell Programming and Scripting 5 01-14-2009 01:06 PM
need help in remove group of files ali560045 Shell Programming and Scripting 6 09-16-2008 08:16 AM
uncompress a group of files ali560045 Shell Programming and Scripting 8 09-05-2008 03:02 AM
group by in files :-) hellsd UNIX for Dummies Questions & Answers 10 06-22-2005 12:47 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 4 Weeks Ago
flyingswan flyingswan is offline
Registered User
  
 

Join Date: Nov 2009
Posts: 1
cat-ing a group of files into two outputs

I have some logic which uses CAT to concatenate group of files, 'SED'-ing some field values and piping the output to one file :-

cat `echo $infilename|sed '{
s/.filestream./'${file_stream}'/g
s/.field2./'${jobopt2}'/g
s/.sb_odate./'${SB_ODATE}'/g
}'` >$outfilename

Now I need to stream the output of that operation to two output files, conditional on the value of the first character of each line of the input files......if the first character is 7 or 8 write the record to one output and if not write it to the alternative output file

I know I could read through the group of input files and add a grep........but can anyone suggest a way of doing it with just one read through the input ?
 

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 10:22 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