Similar Threads:
1.sed to insert lines in a file.
I need to insert multiple lines into a postscript file. I think I can
use sed to do this. I actually have it working, sort of...
I need to insert 9 lines of postscript code into a postscript file
after each line starting with %%Page:
I was thinking I can use the append command with sed, but that only
works for one occurence. I need to be able to insert the lines after
each occurrence of %%Page:, any suggestions? Thanks!!
2.Need help with sed/awk cmd to insert a string in a line
Hi,
I have the following one line :
<tns:ARMLoan MortgageMarginPercent="2.4000"
NegativeAmortizationIndicator="N"
LifetimeMinimumInterestRatePercent="2.40000"
FirstInterestRateChangeDate="2016-03-01"
NextScheduledRateChangeDate="2016-04-01"
InterestRateChangeIndexLookBackPeriod="15"
NextScheduledPaymentChangeDate="2016-05-01" FirstPI
ChangeDate="2016-04-01" RateRoundingMethodCode="T"
ConversionAllowedIndicator="N" RateChangeFrequencyPeriod="1"/
>
I need to append
ARMPlanNumber="03648"
after
NextScheduledRateChangeDate="2016-04-01"
The problem is the date in NextScheduledRateChangeDate is not fixed
and will be different.
Any suggestions to achieve this in Unix would be greatly appreciated.
Thanks in advance !
-Anil
CapriTechnologies,Inc
3.sed insert character in specific position relative to end of line
I couldn't find a posting that told me exactly how to do this, but
after reading related postings and some guesswork I got there, thought
it might be useful to others too:
echo original | sed 's/..$/NEW&/'
originNEWal
echo original | sed 's/.......$/NEW&/'
oNEWriginal
hope its useful
Rich
4.Inserting file after first occurrence of blank line with sed
I'm trying to get sed to insert file X into file Y after the first
occurrence of a blank line in file Y.
Here's the first few lines of file Y:
>From 9b3a3f2695eb4d4c509f5235e0b1860010054fa0 Mon Sep 17 00:00:00 2001
From: Timur Tabi < XXXX@XXXXX.COM >
Date: Tue, 23 Jan 2007 16:49:48 -0600
Subject: [PATCH] Abort booting if the DTB is not version 16
Signed-off-by: Timur Tabi < XXXX@XXXXX.COM >
After trying for 15 minutes, I gave up. This is closest I got:
sed '1,/^$/ { r changelog;}' < fileX
This gives me this error, which I don't understand:
sed: -e expression #1, char 0: Unmatched `{'
Can someone tell me what I'm doing wrong?
5.insert empty lines with sed (shell script)
Hello newsgroup,
I would like to insert empty lines into a textfile via sed.
What I have is the position of the line as a shell variable.
As I tried several ways to implement this code into my script and did
not succed, I ask for help here.
It should look somehow like the following lines, but I do not know how
to tell sed, the line where it should insert an emty line.
linenumber=`cat $file | egrep -o -o "BLATT 2" sed -e's/:.*//g'`
sed -e '($linenumber)i\ # the problem is in this line *
\
' < oldfile > newfile
*the brackets are just to show my intention.
Any suggestions?
Thanks in advance,
Harald Steden
6. sed to insert lines in a file.
7. Sed command, Insert text in front of existing line
8. SED (or awk) If Line X 1st character NEQ B, insert newline