In the awk below I am trying to remove all lines above and including the pattern Test or Test2. Each block is seperated by a newline and Test2 also appears in the lines to keep but it will always have additional text after it. The Test to remove will not. The awk executed until the || was added but only removed the first instance of Test, that is the first 3 lines including the line with Test in it. Thank you .
file
desired
awk
Last edited by cmccabe; 04-01-2019 at 10:39 AM..
Reason: fixed format
I need to remove all lines which does not match the pattern from a text file (batch of text files). I also need to keep the header line which is the first line of the file. Please can you provide an example for that.
I used this to solve half of my work. I was unable to keep the first line of... (3 Replies)
Hi,
I have requirement that I need to split my input file into two files based on a search pattern "abc"
For eg. my input file has below content
abc
defgh
zyx
I need file 1 with
abc
and file2 with
defgh
zyx
I can use grep command to acheive this. But with grep I need... (8 Replies)
Hi ,
I want to remove the specific pattern and remove those lines from file using shell script.
i want to remove these lines
<?xml version='1.0' encoding='UTF-8'?>
<row_set>
</row_set>
my input file has content like this.
file name: sample.xml
<?xml version='1.0'... (4 Replies)
Not sure how I can accomplish this. I would like to remove all interfaces that have the commands I would like to see: switchport port-security, spanning-tree portfast. One line is no problem.
interface FastEthernet0/8
spanning-tree portfast
interface FastEthernet0/9
spanning-tree... (4 Replies)
The intended result should be :
PDF converters
'empty line'
gpdftext and pdftotext?xml version="1.0"?>
xml:space="preserve"><note-content version="0.1" xmlns:/tomboy/link" xmlns:size="http://beatniksoftware.com/tomboy/size">PDF converters
gpdftext and pdftotext</note-content>... (9 Replies)
Sorry for the weird title but i have the following problem.
We have several files which have between 10000 and about 500000 lines in them. From these files we want to remove lines which contain a pattern which is located in another file (around 20000 lines, all EAN codes). We also want to get... (28 Replies)
I am trying to combine lines with these conditions:
1. First line starts with text of "libname VALUE db2 datasrc" where VALUE can be any text.
2. If condition1 is met then continue to combine lines through a line that ends with a semicolon.
3. Ignore case when matching patterns and remove any... (5 Replies)
Team,
I am trying to use sed to delete 15 lines, after pattern patch, which includes the pattern as well in Solaris. I used the below command, as we do it Linux, but it's not working as expected in Solaris.
I am getting the error as "garbled".sed '/\/table/,+15d' status.html
sed: command... (8 Replies)
In the awk piped to sed below I am trying to format file by removing the odd xxxx_digits and whitespace after, then move the even xxxx_digit to the line above it and add a space between them. There may be multiple lines in file but they are in the same format. The Filename_ID line is the last line... (4 Replies)
Discussion started by: cmccabe
4 Replies
LEARN ABOUT DEBIAN
nbtscan
NBTSCAN(1) General Commands Manual NBTSCAN(1)NAME
nbtscan -- program for scanning networks for NetBIOS name information
SYNOPSIS
nbtscan [-v] [-d] [-e] [-l] [-t timeout] [-b bandwidth] [-r] [-q] [-s separator] [-h] [-m retransmits] [-f filename |
scan_range]
DESCRIPTION
This manual page documents briefly the nbtscan command.
This manual page was written for the Debian GNU/Linux distribution because the original program does not have a manual page.
nbtscan is a program for scanning IP networks for NetBIOS name information. It sends NetBIOS status query to each address in supplied range
and lists received information in human readable form. For each responded host it lists IP address, NetBIOS computer name, logged-in user
name and MAC address (such as Ethernet).
OPTIONS
A summary of options is included below.
-v Verbose output. Print all names received from each host.
-d Dump packets. Print whole packet contents. Cannot be used with -v, -s or -h options.
-e Format output in /etc/hosts format.
-l Format output in lmhosts format. Cannot be used with -v, -s or -h options.
-t timeout
Wait timeout seconds for response. Default 1.
-b bandwidth
Output throttling. Slow down output so that it uses no more that bandwidth bps. Useful on slow links, so that ougoing queries
don't get dropped.
-r Use local port 137 for scans. Win95 boxes respond to this only. You need to be root to use this option.
-q Suppress banners and error messages.
-s separator
Script-friendly output. Don't print column and record headers, separate fields with separator.
-h Print human-readble names for services. Can only be used with -v option.
-m retransmits
Number of retransmits. Default 0.
-f filename
Take IP addresses to scan from file "filename"
scan_range
What to scan. Can either be single IP like 192.168.1.1 or range of addresses in one of two forms: xxx.xxx.xxx.xxx/xx or
xxx.xxx.xxx.xxx-xxx.
BUGS
Report bugs to alla@sovlink.ru (that's autor of nbtscan). I cannot promise to do anything but I might well want fix it. Remember: no war-
ranty. At least it's worth what you payed for it.
AUTHOR
This manual page was written by Ryszard Lach rla@debian.org for the Debian GNU/Linux system (but may be used by others) and is based on
nbtscan author's README file. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Docu-
mentation License, Version 1.1 or any later version published by the Free Software Foundation.
NBTSCAN(1)