Sponsored Content
Top Forums Shell Programming and Scripting AWK find/replace 2 strings in one shot Post 302331399 by shrijith1 on Monday 6th of July 2009 05:19:23 AM
Old 07-06-2009
Thanks zaxxon, it works.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

awk find/replace

Greetings all. I have web site that has long option and switch lists. When I insert something new into these files, the lists need to be reordered. IE: 1 => apple 2 => pear 3 => bannana 4 => orange --------------------- Add grape as #2 1 => apple 2 => grape 3 => pear 4 =>... (2 Replies)
Discussion started by: RobertSubnet
2 Replies

2. Shell Programming and Scripting

Help with Find/Replace Javascript Injected Strings in mulitple files

Hi, guys, I'm not a high-end programmer, but I've been trying to write a script to remove all of the b.rtbn2.cn (and b.adserv.cn and any future variation) injected script tags on the server. (Still working on security fixes to prevent it in the future, just need to clean up now.) My approach is... (1 Reply)
Discussion started by: zzlegs
1 Replies

3. Shell Programming and Scripting

Replace Strings with sed or awk

Hello i need some help with the usage of sed. Situation : 2 textfiles, file.in , file.out In the first textfile which is called file.in are the words for the substitution. Every word is in a new-line like : Firstsub Secondsub Thridsub ... In the second textflie wich is called file.out is... (5 Replies)
Discussion started by: Kingbruce
5 Replies

4. UNIX for Dummies Questions & Answers

how to find and replace strings in multiple files

Hi All, Iam new to unix, I need to find string and replace it in the file name. Like text_123_0.txt,text_123_1.txt,text_123_2.txt. I need to search 123 and replace it with 234 . Is there any unix command to replace them in single command since i have 5 directories. So i need to go each and every... (0 Replies)
Discussion started by: etldeveloper
0 Replies

5. UNIX for Advanced & Expert Users

Find and replace txt between two strings in flat file

Hi There... I need to serach and replace strngs in a text file. My file has; books.amazon='Let me read' news.bestseller='xyz' expected output is books.amazon=NONFOUND news.bestseller=NONFOUND Can I first find the text between string1= books.amazon=' and string2= ' (locate the text... (1 Reply)
Discussion started by: Hiano
1 Replies

6. Shell Programming and Scripting

Find multiple strings and replace single string

Hi, following Perl code i used for finding multiple strings and replace with single string. code: #!/usr/bin/perl my @files = <*.txt>; foreach $fileName (@files) { print "$fileName\n"; my $searchStr = ',rdata\)' | ',,rdata\)' | ', ,rdata\)'; my $replaceStr =... (2 Replies)
Discussion started by: chettyravi
2 Replies

7. Shell Programming and Scripting

Using awk to replace strings

Hi.. I have a file that has the following content : abc 213 24 213 pqr 456#34 678 xyz 213 45%213 i need to write an awk script that will replace the second 213 in all the lines, if it is present. The IFS can not be specified and can be random. The number of lines in the file and the... (5 Replies)
Discussion started by: Hermione Grange
5 Replies

8. Programming

How to replace the complex strings from a file using sed or awk?

Dear All, I am having a requirement to find the difference between 2 files and generate a discrepancy report out of it as an html page. I prefer using diff -y file1 file2 since it gives user friendly layout to know any discrepancy in the record and unique records among the 2 file. Here's how it... (12 Replies)
Discussion started by: Badhrish
12 Replies

9. Shell Programming and Scripting

sed Find and Replace Text Between Two Strings or Words

I am looking for a sed in which I can recognize all of the text in between two indicators and then replace it with a place holder. For instance, the 1st indicator is a list of words "no|noone|havent" and the 2nd indicator is a list of punctuation ".|,|!".From a sentence such as "noone... (3 Replies)
Discussion started by: owwow14
3 Replies

10. UNIX for Beginners Questions & Answers

sed find 2 strings and replace one

Hi Everyone, I want to find this 2 strings in a single line a file and replace the second string. this is the line i need to find <param name="user" value="CORE_BI"/> find user and CORE_BI and replace only CORE_BI with admin so finally the line should look like this. <param... (5 Replies)
Discussion started by: shajay12
5 Replies
NG_RFC1490(4)						   BSD Kernel Interfaces Manual 					     NG_RFC1490(4)

NAME
ng_rfc1490 -- RFC 1490 netgraph node type SYNOPSIS
#include <netgraph/ng_rfc1490.h> DESCRIPTION
The rfc1490 node type performs protocol encapsulation, de-encapsulation, and multiplexing according to RFC 1490 (which has since been updated by RFC 2427). This particular type of encapsulation is often used on top of frame relay DLCI channels. The downstream hook is used to transmit and receive encapsulated frames. On the other side of the node, the inet and ppp hooks are used to transmit and receive raw IP frames and PPP frames, respectively. PPP frames are transmitted and received according to RFC 1973; in particu- lar, frames appearing on the ppp hook begin with the PPP protocol number. The ethernet hook can be used to transmit and receive Ethernet frames (without a checksum) in RFC 1490's bridging format. Typically the inet hook is connected to the inet hook of an ng_iface(4) node. HOOKS
This node type supports the following hooks: downstream Connects to the RFC 1490 peer entity. ethernet Transmits and receives bridged raw Ethernet frames, without a checksum. inet Transmits and receives raw IP frames. ppp Transmits and receives PPP frames. CONTROL MESSAGES
This node type supports the generic control messages, plus the following: NGM_RFC1490_SETENCAP This command sets encapsulation method for the node. The desired method must be passed as a string message argument, and must be one of the following supported encapsulation modes: "ietf-ip" IP packets are sent using simple RFC1490/2427 encapsulation. "ietf-snap" IP packets are sent inside SNAP frames. Also conforms to RFC1490/2427. "cisco" IP packets are sent and received using proprietary Cisco encapsulation method. NGM_RFC1490_GETENCAP This command returns current encapsulation method on the node. SHUTDOWN
This node shuts down upon receipt of a NGM_SHUTDOWN control message, or when all hooks have been disconnected. SEE ALSO
netgraph(4), ng_frame_relay(4), ng_iface(4), ngctl(8) C. Brown and A. Malis, Multiprotocol Interconnect over Frame Relay, RFC 2427. W. Simpson, PPP in Frame Relay, RFC 1973. http://www.cisco.com/warp/public/121/frf8modes.pdf HISTORY
The ng_rfc1490 node type was implemented in FreeBSD 4.0. AUTHORS
Julian Elischer <julian@FreeBSD.org> BUGS
Not all of RFC 1490 is implemented. BSD
January 19, 1999 BSD
All times are GMT -4. The time now is 10:56 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy