I have a file with 14million lines and I would like to extract all the unique lines from the file into another text file.
For example:
Contents of file1
happy
sad
smile
happy
funny
sad
I want to run a command against file one that only returns the unique lines (ie 1 line for happy... (3 Replies)
Hi all! Im trying to extract a portion of text from a file and put it into a new file. I need all the lines between <Placement> and </Placement> including the Placemark lines themselves. Is there a way to extract all instances of these and not just the first one found? I've tried using sed and... (4 Replies)
I'm attempting to write a script to identify users who have sudo access on a server. I only want to extract the ID's of the sudo users after a unique line of text. The list of sudo users goes to the EOF so I only need the script to start after the unique line of text. I already have a script to... (1 Reply)
Is there a trick for copying from something like a powerpoint into vi? Every time I try to copy text from something like a powerpoint to vi my spacing gets messed up. I think it has something to do with my .vimrc file. When I renamed it was able to copy it in just fine so can someone please... (2 Replies)
Hi All,
I'm hoping this is an easy question, but I'm having a weird problem trying to simply copy and paste text from MS Windows (XP) Notepad and then pasting into vi or vim in AIX. When I type "oslevel" I get "5.3.0.0". The problem is that once the text is pasted, there are sections of text... (2 Replies)
I would like to replace ], with ]]], between /* SECTION2-BEGIN */ and /* SECTION2-END */ in my file. My file contains the following information:
/* SECTION1-BEGIN */
,
/* SECTION1-END */
/* SECTION2-BEGIN */
,
/* SECTION2-END */
/*... (5 Replies)
Hi All,
I want to extract the text between some pattern which occurs repeatedly in a file. For example my input is like,
/home/.....
..........java:25: cannot find symbol
............
/home/......
/home/.......
I want to display... (2 Replies)
I need to filter the text in between two patterns and output that to a different file. Please help me how to do it.
Ex:
.............
<some random text>
.............
Pattern_1
<Few lines that need to be output to different file>
Pattern_2
................
...............
<more text in... (4 Replies)
awk -F "" '/<TestName>|<testname>|<Offerer>|<offerer>|<Line1>|<line1>|<City>|<city>|<State>|<state>/ {print $2, $3}' OFS='\t' UBE3A.xml > UBE3A.txt
Is it possible to use the code above to search for a pattern that is non-unique?
For example, if I wanted to capture the<MethodList>|<string>... (6 Replies)
I am trying to use awk to print the unique entries in $2
So in the example below there are 3 lines but 2 of the lines match in $2 so only one is used in the output.
File.txt
chr17:29667512-29667673 NF1:exon.1;NF1:exon.2;NF1:exon.38;NF1:exon.4;NF1:exon.46;NF1:exon.47 703.807... (5 Replies)
Discussion started by: cmccabe
5 Replies
LEARN ABOUT DEBIAN
snsplit
snsplit,v0.3.8(8) System Manager's Manual snsplit,v0.3.8(8)NAME
snsplit - split an article stream into individual articles
SYNOPSIS
snsplit [-r] [field... -] prog...
DESCRIPTION
snsplit reads an article stream from descriptor 0 and splits it into separate articles, invoking prog... on each, with the article ava-
iable on descriptor 0. This is useful as a quick-and-dirty way of filtering an article stream.
The incoming article stream is expected to be in wire format, with lines ending in CRLF, leading dots doubled, and delimited by a dot on a
line by itself.
The article presented to prog... will have lines that end in a bare newline, will have all header lines unfolded, leading dots will be
unstuffed, and the article will be terminated by end-of-file.
ARGUMENTS
prog...
is the program (with arguments) to run on each article. If prog... exits with any kind of failure, snsplit aborts.
field...-
are optional header field names. If these are specified, the value of the first header field of that name will be exported into the
environment. This field... list must be terminated by the hyphen. See also ENVIRONMENT below.
OPTIONS -r Expect input articles in rnews batch format instead.
ENVIRONMENT
snsplit sets some environment variables. If the environment already contains these variables, they will be overwritten.
SEQUENCE
If already set to a positive value, it is incremented for the first article. If it isn't set, is set to one for the first article.
Thereafter it is incremented for each subsequent article. The value is always a 6-digit number with leading zeroes, and it can roll
over.
BYTES contains the size of the current article.
HEAD_LINES
The number of lines in the head of the article, excluding the blank separator line.
BODY_LINES
The number of lines in the body of the article, excluding the blank separator line.
FLD_FIELD
If any fields are specified on the command line, where field is the name of an article header field, then FLD_FIELD will be set to
the value of field, where FIELD is the same as field but with lower case characters changed to upper case, and all hyphens changed
to underscores. Confusing? If field is message-id, then FLD_MESSAGE_ID will be set to the value of the first Message-ID field in
the current article, if there is one.
EXIT CODES
snsplit exits 0 on success, 1 on usage error, 2 on system error, and 3 on article format error. If prog... exits with other than 0,
snsplit will also exit that value.
N.B. Harold Tay snsplit,v0.3.8(8)