04-14-2010
Help please, extract multiple lines from a text file
Hi all,
I need to extract lines between the lines 'RD' and 'QA' from a text file (following). there are more that one of such pattern in the file and I need to extract all of them. however, the number of lines between them is varied in the file. Therefore, I can not just use 'grep -A' command. Any suggestion would be appreciated.
Many thanks
---------------------------------------------------------
........
RD FTLH3RB02II3DW 333 0 0
GG**A***AC*AC*ACACACACAC*ACACACACACATGCTTGCACACAAT
CT*GAAATCTTCACTAA*TCTTTATCTTAAATC*AGTT*GGA*T*GTAGA
CAGACACCTGAG*TCATTTAGTCTAATGATGGC*GT*CCCTCACTC*AGG
GCAAGAAATGCTTTCCTCCA*T*GG*A*GAGGTT*AC*AG*TC*TGTT*G
*CC*TCAA*C*TCC*TGTCAGCCTCCAGCTGCTGACA*GG*A**T*CCTG
T*GCCC*TCTC*TT*GT*AGGATGGAGA*GA*TGT*GGTCCTCTATCAAT
TGTACCATCTGTGCTTGTGTGAAAGGCAGG*AC
QA 1 333 1 333
DS CHROMAT_FILE: none PHD_FILE: none TIME: Mon Jan 01 00:00:00 000
........
--------------------------------------------------
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi,
I need to extract data from a text file in which data has a pattern. I need to extract all repeated pattern and then save it to different files.
example:
input is:
ST*867*000352214
BPT*00*1000352214*090311
SE*1*1
ST*867*000352215
BPT*00*1000352214*090311
SE*1*2
... (5 Replies)
Discussion started by: apjneeraj
5 Replies
2. Shell Programming and Scripting
Hi
I want to extract certain text between two line numbers like
23234234324 and
54446655567567
How do I do this with a simple sed or awk command?
Thank you.
---------- Post updated at 06:16 PM ---------- Previous update was at 05:55 PM ----------
found it:
sed -n '#1,#2p'... (1 Reply)
Discussion started by: return_user
1 Replies
3. Shell Programming and Scripting
I have two files
file A which have a number in every row and file B which contains few hundred thousand rows with about 300 characters in each row (csv)
What I need is to extract whole rows from B file (only these which numbers are indicated in A file)
I also need to use cygwin.
Any... (7 Replies)
Discussion started by: gunio
7 Replies
4. Shell Programming and Scripting
I am attempting to insert multiple lines of text into a specific place in a text file based on the lines above or below it.
For example, Here is a portion of a zone file.
IN NS ns1.domain.tld.
IN NS ns2.domain.tld.
IN ... (2 Replies)
Discussion started by: cdn_humbucker
2 Replies
5. Shell Programming and Scripting
input file
Desired csv output
gc_type, date/time, milli secs
af, Mar 17 13:09:04 2011, 144.596
af, Mar 20 00:37:37 2011, 144.242
af, ar 20 21:30:59 2011, 108.518
Hi All,
Any help in acheiving the above would be appreciated. I would like to parse through lines within one file and... (5 Replies)
Discussion started by: satish.vampire
5 Replies
6. Shell Programming and Scripting
Hi all,
Please go through my requirement.
I have a log file in the location /opt/WebSphere61/AppServer/profiles/EMQbatchprofile/logs/EMQbatch
This file contains the follwing pattern data
<af type="tenured" id="42" timestamp="May 14 13:44:13 2011" intervalms="955.624">
<minimum... (8 Replies)
Discussion started by: satish.vampire
8 Replies
7. Shell Programming and Scripting
Hello. I am sorry if this is a common question but through all my searching, I haven't found an answer which matches what I want to do.
I am looking for a sed command that will parse through a large text file and extract lines that start with specific words (which are repeated throughout the... (4 Replies)
Discussion started by: MrDumbQuestion
4 Replies
8. Shell Programming and Scripting
Hi All
I have text file like this:
a=21ej
c=3tiu32
e=hydkehw
f=hgdiuw
g=jhdkj
a=klkjhvl
b=dlkjhyfd
a=yo
c=8732
Any way I can process data from first a to just before of second a, and then second a to just before of 3rd one.
Just fetching records like that will help, I mean... (3 Replies)
Discussion started by: sandipjee
3 Replies
9. UNIX for Dummies Questions & Answers
I would like to use grep to select multiple lines from a text file using a single-column text file. Basically I want to only select lines from the first text file where the second column of the first text file matches the second text file. How do I go about doing that? Thanks! (5 Replies)
Discussion started by: evelibertine
5 Replies
10. Shell Programming and Scripting
I have a file that has some lines starts with *
I want to get these lines, then get the word between "diac" and "lex".
ex.
file:
;;WORD AlAx
*0.942490 diac:Al>ax lex:>ax_1 bw:Al/DET+>ax/NOUN+ gloss:brother pos:noun prc3:0 prc2:0 prc1:0 prc0:Al_det per:na asp:na vox:na mod:na gen:m num:s... (4 Replies)
Discussion started by: Viernes
4 Replies
LEARN ABOUT SUNOS
file-roller
file-roller(1) User Commands file-roller(1)
NAME
file-roller - create, view, modify, or unpack an archive
SYNOPSIS
file-roller [--add] [--add-to=archive] [--default-dir=folder] [--extract] [--extract-to=folder] [--force] [--help] [--usage]
DESCRIPTION
The File Roller application enables you to create, view, modify, or unpack an archive. An archive is a file that acts as a container for
other files. An archive can contain many files, folders, and subfolders, usually in compressed form.
OPTIONS
The following options are supported:
--add Ask for the name of the archive, then add the files, then quit the application. You can also use -a to specify this
option.
--add-to=archive Add files to the specified archive, then quit the application. You can also use -d to specify this option.
--default-dir=folder Specify the default folder for the--add and --extract options.
--extract Ask for the name of the destination folder, then extract the files, then quit the application. You can also use -f
to specify this option.
--extract-to=folder Extract archives to the specified folder, then quit the application. You can also use -e to specify this option.
--force Create the destination folder without asking for confirmation.
--help Display help text. You can also use -? to specify this option.
--usage Display brief usage text.
EXAMPLES
Example 1: Unpacking an Archive
example% file-roller --extract archive
EXIT STATUS
The following exit values are returned:
0 Application exited successfully
>0 Application exited with failure
FILES
The following files are used by this application:
/usr/bin/file-roller Executable for File Roller application.
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Availability |SUNW |
+-----------------------------+-----------------------------+
|Interface stability |External |
+-----------------------------+-----------------------------+
SEE ALSO
File Roller Manual
NOTES
Written by Laszlo Kovacs, Sun Microsystems Inc., 2003.
SunOS 5.10 29 Sep 2003 file-roller(1)