Sponsored Content
Top Forums Shell Programming and Scripting sed command to replace a line at a specific line number with some other line Post 302797749 by vivek d r on Tuesday 23rd of April 2013 06:14:29 AM
Old 04-23-2013
thanks guys.. works good :-)
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Adding a columnfrom a specifit line number to a specific line number

Hi, I have a huge file & I want to add a specific text in column. But I want to add this text from a specific line number to a specific line number & another text in to another range of line numbers. To be more specific: lets say my file has 1000 lines & 4 Columns. I want to add text "Hello"... (2 Replies)
Discussion started by: Ezy
2 Replies

2. Shell Programming and Scripting

using sed to replace a specific string on a specific line number using variables

using sed to replace a specific string on a specific line number using variables this is where i am at grep -v WARNING output | grep -v spawn | grep -v Passphrase | grep -v Authentication | grep -v '/sbin/tfadmin netguard -C'| grep -v 'NETWORK>' >> output.clean grep -n Destination... (2 Replies)
Discussion started by: todd.cutting
2 Replies

3. Shell Programming and Scripting

How would i delete a line at specific line number

Hi guys , I m writing a script to delete a line at particular location. But i m unable to use variable for specifying line number. for example. sed -n '7!p' filename works fine and deletes 7th line from my file but sed -n '$variable!p' filename gives following error. sed: -e... (12 Replies)
Discussion started by: pinga123
12 Replies

4. Shell Programming and Scripting

sed script - print the line number along with the line

Hi, I want to print the line number with the pattern of the line on a same line using multi-patterns in sed. But i don't know how to do it. For example, I have a file abc def ghi I want to print 1 abc 2 def 3 ghi I know how to write it one line code, but i don't know how to put... (11 Replies)
Discussion started by: ntpntp
11 Replies

5. Shell Programming and Scripting

Replace specific field on specific line sed or awk

I'm trying to update a text file via sed/awk, after a lot of searching I still can't find a code snippet that I can get to work. Brief overview: I have user input a line to a variable, I then find a specific value in this line 10th field in this case. After asking for new input and doing some... (14 Replies)
Discussion started by: crownedzero
14 Replies

6. Shell Programming and Scripting

I need to know how to replace a line after a pattern match with an empty line using SED

Hi How Are you? I am doing fine! I need to go now? I will see you tomorrow! Basically I need to replace the entire line containing "doing" with a blank line: I need to the following output: Hi How Are you? I need to go now? I will see you tomorrow! Thanks in advance.... (1 Reply)
Discussion started by: sags007_99
1 Replies

7. Shell Programming and Scripting

sed to replace specific positions on line with file contents

Hi, I am trying to use an awk command to replace specific character positions on a line beginning with 80 with contents of another file. The line beginning with 80 in file1 is as follows: I want to replace the 000000000178800 (positions 34 - 49) on this file with the contents of... (2 Replies)
Discussion started by: nwalsh88
2 Replies

8. Shell Programming and Scripting

Multiple line search, replace second line, using awk or sed

All, I appreciate any help you can offer here as this is well beyond my grasp of awk/sed... I have an input file similar to: &LOG &LOG Part: "@DB/TC10000021855/--F" &LOG &LOG &LOG Part: "@DB/TC10000021852/--F" &LOG Cloning_Action: RETAIN &LOG Part: "@DB/TCCP000010713/--A" &LOG &LOG... (5 Replies)
Discussion started by: KarmaPoliceT2
5 Replies

9. Shell Programming and Scripting

sed command to replace a line in a file using line number from the output of a pipe.

Sed command to replace a line in a file using line number from the output of a pipe. Is it possible to replace a whole line piped from someother command into a file at paritcular line... here is some basic execution flow.. the line number is 412 lineNo=412 Now i have a line... (1 Reply)
Discussion started by: vivek d r
1 Replies

10. Shell Programming and Scripting

Replace values in script reading line by line using sed

Hi all, Let's say I have a script calling for the two variables PA_VALUE and PB_VALUE. for pa in PA_VALUE blah blah do for pb in PB_VALUE blah blah do I have a text file with two columns of values for PA and PB. 14.5 16.7 7.8 9.5 5.6 3.6 etc etc I would like to read this... (7 Replies)
Discussion started by: crimsonengineer
7 Replies
Devel::StackTrace::WithLexicals(3pm)			User Contributed Perl Documentation		      Devel::StackTrace::WithLexicals(3pm)

NAME
Devel::StackTrace::WithLexicals - Devel::StackTrace + PadWalker SYNOPSIS
use Devel::StackTrace::WithLexicals; my $trace = Devel::StackTrace::WithLexicals->new; ${ $trace->frame(1)->lexical('$self') }->oh_god_why(); DESCRIPTION
Devel::StackTrace is pretty good at generating stack traces. PadWalker is pretty good at the inspection and modification of your callers' lexical variables. Devel::StackTrace::WithLexicals is pretty good at generating stack traces with all your callers' lexical variables. METHODS
All the same as Devel::StackTrace, except that frames (in class Devel::StackTrace::WithLexicals::Frame) also have a "lexicals" method. This returns the same hashref as returned by PadWalker. If the "no_refs" option to Devel::StackTrace is used, then each reference is stringified. This can be useful to avoid leaking memory. Simple, really. AUTHOR
Shawn M Moore, "sartak@gmail.com" BUGS
I had to copy and paste some code from Devel::StackTrace to achieve this (it's hard to subclass). There may be bugs lingering here. COPYRIGHT AND LICENSE
Copyright 2008-2009 Shawn M Moore. Some portions written by Dave Rolsky, they belong to him. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.14.2 2011-04-22 Devel::StackTrace::WithLexicals(3pm)
All times are GMT -4. The time now is 05:05 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy