Insert lines above matching line with content from matching
Hi, I have text file:
I want to insert 2 new lines before the 'Address: ' line deriving value from this Address line value
The Address value in quotes until the first semi-colon should form the StreetName, and until underscore(_) within this should form the StreetNo,
as shown below
Also it would be nice to have the additional check that the code only inserts where the 2 lines (StreetNo, StreetName) are not already available
Thanks,
-sri
i am not sure what i should be using but would like a simple command that is able to insert a certain block of text that i define or from another text file into a xml file after a certain match is done
for e.g
insert the text
</servlet-mapping>
<!-- beechac added - for epic post-->... (3 Replies)
Hi all,
I was wondering if someone could tell me a way to extract from a file lines where you search for a phrase and then also extract the next X lines after it (i.e. take a block of text from the file)?
Example
{
id=123
time=10:00:00
date=12/12/09
{
........
... (6 Replies)
Sample file:
This is line one,
this is another line,
this is the PRIMARY INDEX line
l ;
This is another line
The command should find the line with “PRIMARY INDEX” and remove the last character from the line preceding it (in this case , comma) and remove the first character from the line... (5 Replies)
Hi all,
on Solaris 10, I'd like to print a range of lines starting at pattern but also including the very first line before pattern.
the following doesn't print the range starting at pattern and going down to the end of file: cat <my file> | sed -n -e '/<pattern>{x;p;}/'
I need to include the... (1 Reply)
Hi, i need help with my shell script
I have a file input.txt containing the following contents
/.
/usr
/usr/share
/usr/share/doc
/usr/share/doc/wine
/usr/share/doc/wine/copyright
/usr/share/doc/wine/changelog.Debian.gz
I need output as
/usr/share/doc/wine
/usr/share/doc/wine/copyright... (3 Replies)
Hello,
I have two files file 1 and file 2 each having result of a query on certain database tables and need to compare for Col1 in file1 with Col3 in file2, compare Col2 with Col4 and output the value of Col1 from File1 which is a) not present in Col3 of File2 b) value of Col2 is different from... (2 Replies)
Dear Unix Forums,
I am hoping you can help me with a pattern matching problem.
What am I trying to do?
I want to replace multiple lines of a text file (that match a multi-line pattern) with a single line of text. These patterns can span several lines and do not always have the same number of... (10 Replies)
At the top of the XYZ file, I need to insert the ABC data value of column 2 only when ABC column 1 matches the prefix XYZ file name (not the ".txt"). Is there an awk solution for this?
ABC Data
0101 0.54
0102 0.48
0103 1.63
XYZ File Name
0101.txt
0102.txt
0103.txt
... (7 Replies)
Hi Guys,
I am trying to format my csv file. When I spool the file using sqlplus the single row output is wrapped on three lines.
Somehow I managed to format that file and finally i am trying to make the multiple line on single line.
The below command is working fine but I need to pass the... (3 Replies)
Discussion started by: RJSKR28
3 Replies
LEARN ABOUT DEBIAN
stund
STUND(8)STUND(8)NAME
stund - STUN protocol (Simple Traversal of UDP through NATs) Server
SYNTAX
stund [-v] [-h IP Address] [-a Secondary IP Address ] [-p port ] [-o port ] [-b ] [-m ]
STUN servers needs two IP addresses and two ports
DESCRIPTION
STUN Servers are used to help clients behind NAT to tunnel incoming calls through. This server is the counterpart to help the client iden-
tify the NAT and have it open the proper ports for it
OPTIONS -v Verbose output.
-h <IP Address>
Define the Main IP Address.
-a <IP Address>
Define the Second IP Address.
-p <Port>
Set the primary port the default port value is 3478
-o <Port>
Set the secondary port the default port value is 3479 -b Detach the process and makes the program run at the background
-m <Port>
Sets a starting port for the STERM server
--help Prints useful help
EXAMPLES
If the IP addresses of your NIC are 10.0.1.150 and 10.0.1.151 the proper and default use would be:
stund -h 10.0.1.150 -a 10.0.1.151
add -b option to detach the process
stund -h 10.0.1.150 -a 10.0.1.151 -b
AUTHORS
This manual page was written by Rene Mayorga <rmayorga@debian.org.sv> for the Debian system (but may be used by others). Permis-
sion is granted to copy, distribute and/or modify this document under the terms of the GNU General Public License, Version 2 any later
version published by the Free Software Foundation.
On Debian systems, the complete text of the GNU General Public License can be found in /usr/share/common-licenses/GPL.
SEE ALSO stun(1)Debian Project 2007 Aug 31 STUND(8)