Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Copying Text between two unique text patterns Post 302277311 by praveen21 on Friday 16th of January 2009 02:42:26 AM
Old 01-16-2009
Error How to grep the text between patterns

Hi
I am having a very small problem,but just cdnt find out the solution.

I am having a file which has multiple entries as :

<id>QIIC.QA</id>
<id>.AEX</id>
<id>QIIC</id>
..
I want the output as
QIIC.QA
.AEX
QIIC


And then check which pattern has been repeated and how many times?
Please Help.
Thanks.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

extracting unique lines from text file

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)
Discussion started by: soliberus
3 Replies

2. Shell Programming and Scripting

Extracting Text Between Two Unique Lines

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)
Discussion started by: Grizzly
4 Replies

3. Shell Programming and Scripting

Extracting several lines of text after a unique string

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)
Discussion started by: bouncer
1 Replies

4. UNIX for Advanced & Expert Users

Vi copying text

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)
Discussion started by: cokedude
2 Replies

5. UNIX for Dummies Questions & Answers

Copying text from Windows to AIX - missing text?

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)
Discussion started by: PlainInverted
2 Replies

6. Shell Programming and Scripting

Replacing text between two patterns

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)
Discussion started by: azdps
5 Replies

7. Shell Programming and Scripting

Need to extract text repetitively between two patterns

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)
Discussion started by: Vignesh58
2 Replies

8. Shell Programming and Scripting

Find patterns and filter the text

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)
Discussion started by: metturr
4 Replies

9. Shell Programming and Scripting

Command for non-unique text

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)
Discussion started by: cmccabe
6 Replies

10. Shell Programming and Scripting

awk to print unique text in field

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
SCANSPOOL(8)						    InterNetNews Documentation						      SCANSPOOL(8)

NAME
scanspool - Perform a sanity scan over all articles in news spool SYNOPSIS
scanspool [-cnv] [-a active-file] [-s spool-dir] DESCRIPTION
scanspool is a Perl script for use with a tradspool article spool. It will scan the active file as well as all articles in the spool and report on the errors it encounters. As this may take a while, using the -v switch is recommended to see how far the program has progressed. First, scanspool scans the active file, noting problems such as: o malformed lines; o newsgroups aliased to a non-existent newsgroup; o newsgroups aliased to a newsgroup that is also aliased. Then it will examine all articles under your news spool directory, complaining about articles that: o have a basename that starts with a leading 0; o have a basename that is out of range according to the active file; o do not contain a Newsgroups: header line; o are all header and no text; o are in a directory for which there is no newsgroup in the active file; o are in a newsgroup to which they do not belong. scanspool understands aliased newsgroups. Thus, if an article is posted to foo.old.name that is aliased to foo.bar, it will be expected to be found under foo.bar and not foo.old.name. Articles posted to a newsgroup of status "j" or "x" (the fourth field of the active file) will be expected to show up under the junk group. scanspool assumes that the path of a valid newsgroup's directory from the root of the spool tree will not contain any "." character. Thus, directories such as out.going, tmp.dir, in.coming and news.archive will not be searched. This program also assumes that article basenames contain only decimal digits. Last, files under the top level directory lost+found are not scanned. OPTIONS
-a active-file The active file to use; pathdb/active is the default. -c Only check article filenames. scanspool will therefore not actually scan the Newsgroups: header field of the articles. -n Don't throttle innd while scanning. -s spool-dir The root of the spool tree; patharticles is the default. -v Setting this flag enables a verbose mode. scanspool will then print which newsgroup is currently worked upon. It will list all the articles found in non-active directories (that is to say articles sorted into groups no longer present in the active file), rather than just printing the group once. DIAGNOSTICS
The output of scanspool will start with one of the following forms: "FATAL:" (to stderr) Fatal or internal error. "WARN:" (to stderr) active or article format problem, newsgroup alias problem, find(1) error, article open error. "path/123:" (to stdout) Issues such as: o basename starts with 0; o article number out of range; o article in the wrong directory; o article in a directory not related to an active non-aliased newsgroup. " ..." (to stdout) Verbose messages start with a tab. BUGS
scanspool is unable to detect and properly deal with spool formats other than tradspool. However, if the files that store your articles are named other than just all-digits, they will simply be skipped (and your active is still checked). scanspool only considers the first line of the Newsgroups: header field. Continuation lines are not taken into account. HISTORY
scanspool was written by Landon Curt Noll (chongo was here /../). This manual page was written by Florian Schlichting, largely based on comments in the script. $Id: scanspool.pod 9302 2011-08-04 21:10:17Z iulius $ SEE ALSO
active(5). INN 2.5.3 2011-08-22 SCANSPOOL(8)
All times are GMT -4. The time now is 04:25 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy