Advertisement

09.24.2008 at 08:55AM PDT, ID: 23759191 | Points: 500
[x]
Attachment Details

Using a shell script to automatically modify a text file

Asked by trisha40 in Unix Systems Programming

Tags:

I am trying to use SED to change values in a text file in Unix.  I want to:
1.  Search and replace all the string date value in column 4 to display the current date(sysdate).  Would I use /g?
2.  I want to remove the spaces from column 6 and concatenate the first 2 characters of  the first column into column 6(the comment field).  The comment field always begins with a date and may or may not always have blank spaces before the comments begin.  

 I have very limited experience with SED and would appreciate any help.  I am attaching a sample of the current format, as well as what the text should look like after converting the data.

ThanksStart Free Trial
Attachments:
 
Sample of text file
 
 
Loading Advertisement...
 
[+][-]09.24.2008 at 09:59PM PDT, ID: 22566346

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 14-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09.28.2008 at 12:39AM PDT, ID: 22590180

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 14-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20081112-EE-VQP-43 / EE_QW_2_20070628