Sponsored Content
Top Forums Shell Programming and Scripting grep a pattern and replace a value in it and write to the same file. Post 302352356 by yesmani on Friday 11th of September 2009 05:44:02 AM
Old 09-11-2009
yes, u are right,, i expect the outut as above,,

but i would like to rremind that the original file contains "server4" as a value for more than one DB target,, i mean not only DEV_2 target is server4 but also say DEV_3 will be targetted to server4.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

help needed .. Unable to write the data to new file after matching the pattern

Hi, i am pretty new to Unix environment ..... Can i get some help from any of you guyz on writing Unix script. my requirement is like reading a csv file, finding a specific pattern in the lines and repalce the string with new string and write it to another file. My file is file ABC123.dat... (3 Replies)
Discussion started by: prashant_jsw
3 Replies

2. Shell Programming and Scripting

How to replace some content of a file and write with a new name

Hi I have a control file which looks like this LOAD DATA INFILE '/home/scott/XXX.dat' PRESERVE BLANKS ............. ............. how can i change the content of this file and replace the file in the second line with anothe file name and write it back with another name to the disk? ... (5 Replies)
Discussion started by: mwrg
5 Replies

3. Shell Programming and Scripting

How to delete a string pattern in a file and write back to the same file

I have a control file which looks like this LOAD DATA INFILE '/array/data/data_Finished_T5_col_change/home/oracle/emp.dat' PRESERVE BLANKS INTO TABLE SCOTT.EMP FIELDS TERMINATED BY '|' OPTIONALLY ENCLOSED BY '"' TRAILING NULLCOLS (................. ..................) How can i edit the... (1 Reply)
Discussion started by: mwrg
1 Replies

4. Shell Programming and Scripting

Replace a particular pattern in a file

Hi , I have a requirement where i have this file abcd $$xyz=123 $$zef=789 $$mno=123 $$pqr=456 I need to replace $$pqr from 456 to a new value which will be present in a variable to me. I am not aware of sed and awk functionality. Can somebody please show me how to replace this... (6 Replies)
Discussion started by: lifzgud
6 Replies

5. UNIX for Dummies Questions & Answers

Write to file using tail -f through a pipe to grep

Hi -- I'm looking to write to a file after piping output from tail -f through to grep: #write to a file for all lines with "searchtext" within in error_log: Expand|Select|Wrap|Line Numbers tail -f /var/error_log | grep searchtext > output.txt The above command... (2 Replies)
Discussion started by: ndedhia1
2 Replies

6. Shell Programming and Scripting

script to grep a pattern from file compare contents with another file and replace

Hi All, Need help on this I have 2 files one file file1 which has several entries as : define service{ hostgroup_name !host1,!host5,!host6,.* service_description check_nrpe } define service{ hostgroup_name !host2,!host4,!host6,.* service_description check_opt } another... (2 Replies)
Discussion started by: namitai
2 Replies

7. Shell Programming and Scripting

Check for Pattern if exists write to file

Hi ! All I just want to search and write to new file if pattern is found in text file following are my text files by which I want to search Month and last column number my text file1 15-Jan-2011 25 ARTS 1255 125 125 178 198 15-Jan-2011 25 ARTS 1255 125 125 178 198 15-Jan-2011 25... (3 Replies)
Discussion started by: nex_asp
3 Replies

8. Shell Programming and Scripting

Search pattern and write line into another file

Hi, I have a file which contains the below details.. My requirement is to fetch all the lines which are starting with "ABC_XY_" into 1 file and rest of the lines (not starting with "ABC_XY_") into another file. Could you please help with what command needs to be used? file1.txt ----------... (12 Replies)
Discussion started by: satyaatcgi
12 Replies

9. Shell Programming and Scripting

Piping through grep/awk prevents file write

So, this is weird... I'm running this command: iotop -o -P -k -bt -d 5 I'd like to save the output relelvant to rsyslogd to a file, so I do this: iotop -o -P -k -bt -d 5 | grep rsyslogd >> /var/log/rsyslogd Nothing is written to the file! I can write the full output to the file: ... (2 Replies)
Discussion started by: treesloth
2 Replies

10. Shell Programming and Scripting

sed and awk usage to grep a pattern 1 and with reference to this grep a pattern 2 and pattern 3

Hi , I have a file where i have modifed certain things compared to original file . The difference of the original file and modified file is as follows. # diff mir_lex.c.modified mir_lex.c.orig 3209c3209 < if(yy_current_buffer -> yy_is_our_buffer == 0) { --- >... (5 Replies)
Discussion started by: breezevinay
5 Replies
NMSSTORE2DLF.IN(1)					  LogReport's Lire Documentation					NMSSTORE2DLF.IN(1)

NAME
nmsstore2dlf - convert Netscape Messaging Server IMAP or POP log files to the Lire msgstore DLF SYNOPSIS
nmsstore2dlf DESCRIPTION
This program converts Netscape Messaging Server log files generated by the IMAP or POP services to the Lire msgstore DLF. LIMITATIONS
In order to have this parser giving you useful information it is recommended to set the NMS 4 logs at the right level. In order to fix that problem please make sure you did the following. Go on the Netscape Messaging Server 4 Message Store Become the Mail Server user (usually this should not be root but typically a user like mailsrv or whatever was defined at installation time, check for the ownership of the files in your message server instance for example) Go to the right location, something like: server-root/msg-instance For example it could be: /usr/netscape/server4/msg-mymailserver Do: $ ./configutil -o logfile.pop.loglevel -v Informational OK SET $ ./configutil -o logfile.imap.loglevel -v Informational OK SET Then become root, go again to your instance directory like: /usr/netscape/server4/msg-mymailserver and do: # ./stop-msg pop /mailserv1fs/netscape/server4: Stopping POP3 daemon 24789 .... done: 24789 # ./start-msg pop /mailserv1fs/netscape/server4: Starting POP3 daemon .... done: 17509 EXAMPLES
To process a log as produced by Netscape Messaging Server: $ nmsstore2dlf < ns-store.log nmsstore2dlf will be rarely used on its own, but is more likely called by lr_log2report: $ lr_log2report nmsstore < /var/log/ns-store.log > report VERSION
$Id: nmsstore2dlf.in,v 1.9 2006/07/23 13:16:35 vanbaal Exp $ THANKS
Jean-Yves Monnier for supplying a patch. AUTHORS
Arnaud Taddei <Arnaud.Taddei@sun.com>, Arnaud Gaillard <Arnaud.Gaillard@orange.ch>, Elie Dufraiche <Elie.Dufraiche@sun.com> COPYRIGHT
Copyright (C) 2002 Arnaud Taddei <Arnaud.Taddei@sun.com>, Arnaud Gaillard <Arnaud.Gaillard@orange.ch>, Elie Dufraiche <Elie.Dufraiche@sun.com> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program (see COPYING); if not, check with http://www.gnu.org/copyleft/gpl.html. Lire 2.1.1 2006-07-23 NMSSTORE2DLF.IN(1)
All times are GMT -4. The time now is 05:16 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy