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
grep using date format ali560045 Shell Programming and Scripting 4 12-26-2007 08:59 AM
grep using date format ali560045 Shell Programming and Scripting 8 12-11-2007 06:39 PM
how i prepare a c++ code(c code) for implementing my own protocol format amitpansuria High Level Programming 1 09-07-2007 12:09 AM
how to format a grep command jasongr Shell Programming and Scripting 2 11-18-2005 02:07 PM
How to format number/string in ksh GNMIKE Shell Programming and Scripting 2 07-03-2005 04:44 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 10-01-2008
krishna.fuji krishna.fuji is offline
Registered User
  
 

Join Date: Oct 2008
Posts: 5
Thumbs up Grep, then format then prepare a string

Hi

I have a file which is having line like below

Personal Unit=AU003 (Industrial Products Division),Plant=B00089,Departmant=D110

When ever i fine line starting sith Personal Unit and contains Plant Department I need to pick this line and format it like

Personal Unit=AU003
Plant=B00089
Departmant=D110
-->RAM:AU003:B00089110:system date:header of the file

i used sed

sed -e '/Personal Unit/{;h;s/^/#/p;x;}' -e '/Business Unit/{s/,Plant/\nPlant/g' -e 's/,Departmant/\nDepartmant/g'} FileName

But it is not fullfilling my all need
can any one please suggest
 

Bookmarks

Tags
linux commands

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 04:13 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