Whenever you have sed | awk | grep | kitchen | sink, it can probably be done all in one awk. It's a lot more than a glorified 'cut'.
1) Search for a line containing CYTOCHROME C where there's two fields (as delimited by : )
2) Get the next line, clean it up with gsub(strip out " " ";" ","), turn the second field into a regex like [AB]
3) Set field separator to space.
4) For every line thereafter, if the line contains ATOM and the fifth field matches the regex, print the line.
These 2 Users Gave Thanks to Corona688 For This Post:
Hello ,
I need your help to extract a line in a big file , and this line is always 11 lines
before a specific pattern . Do you know a way via Awk ?
Thanks in advance
npn35 (17 Replies)
Hi,
the text line looks like this:
"test1" " " "test2" "test3" "test4" "10" "test 10 12" "00:05:58" "filename.bin" "3.3MB" "/dir/name" "18459"
what's the best way to select any of it? So I can for example get only the time or size and so on.
I was trying awk -F""" '{print $N}' but... (3 Replies)
The text line has the following formats:
what.ever.bla.bla.C01G06.BLA.BLA2
what.ever.bla.bla.C11G33.BLA.BLA2
what.ever.bla.bla.01x03.BLA.BLA2
what.ever.bla.bla.03x05.BLA.BLA2
what.ever.bla.bla.Part01.BLA.BLA2
and other similar ones, I need a way to select the "what.ever.bla.bla" part out... (4 Replies)
This is my first post, please be nice. I have tried to google and read different tutorials.
The task at hand is:
Input file input.txt (example)
abc123defhij-E-1234jslo
456ujs-W-abXjklp
From this file the task is to grep the -E- and -W- strings that are unique and write a new file... (5 Replies)
Hi Guys,
I have a situation wherein I need to extract two lines from below the search string.
Eg.
Current:
$ grep "$(date +'%a %b %e')" alert.log
Mon Apr 12 03:58:10 2010
Mon Apr 12 12:51:48 2010
$
Here I would like the display to be something like
Mon Apr 12... (6 Replies)
Hi,
I need to extract <APPNUMBER> tag alone, if the <college> haas IIT Chennai value. college tag value will have spaces embedded. Those spaces should not be suppresses.
My Source file
<Record><sno>1</sno><empid>E0001</empid><name>Rejsh suderam</name><college>IIT ... (3 Replies)
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)
Hi all,
I got a file that contains the following content, Actually it is a part of the file content,
Installing XYZ XYZA Image, API 18, revision 2
Unzipping XYZ XYZA Image, API 18, revision 2 (1%)
Unzipping XYZ XYZA Image, API 18, revision 2 (96%)
Unzipping XYZ XYZA Image, API 18,... (7 Replies)
Hi,
I have below file structure and need to display hours, minutes and seconds as different fields.
Incase hour or minute field is not there it should default to zero.
*** Total elapsed time was 2 hours, 54 minutes and 40 seconds.
*** Total elapsed time was 42 minutes and 36 seconds.... (7 Replies)
Hi All,
i would like to get some help regarding extracting certain characters from a line grepped.
blahblah{1:F01IRVTUS30XXXX0000000001}{2:I103IRVTDEF0XXXXN}{4:blah
blahblah{1:F01IRVTUS30XXXX0000000001}{2:I103IRVTDEF0XXXXN}{4:blah... (10 Replies)
Discussion started by: mad man
10 Replies
LEARN ABOUT DEBIAN
mu-extract
MU-EXTRACT(1) General Commands Manual MU-EXTRACT(1)NAME
mu_extract - display and save message parts (attachments), and open them with other tools.
SYNOPSIS
mu extract [options] <file> mu extract [options] <file> <pattern>
DESCRIPTION
mu extact is the mu sub-command for extracting MIME-parts (e.g., attachments) from mail messages. It works on message files, and does not
require the message to be indexed in the database.
For attachments, the file name used when saving it, is the name of the attachment in the message. If there is no such name, or when saving
non-attachment MIME-parts, a name is derived from the message-id of the message.
If you specify a pattern (a case-insensitive regular expression) as the second argument, all attachments with filenames matching that pat-
tern will be extracted. The regular expressions are Perl-compatible (as per the PCRE-library).
Without any options, mu extract simply outputs the list of leaf MIME-parts in the message. Only 'leaf' MIME-parts (including RFC822 attach-
ments) are considered, multipart/* etc. are ignored.
OPTIONS -a, --save-attachments
save all MIME-parts that look like attachments.
--save-all
save all non-multipart MIME-parts.
--parts=<parts>
only consider the following numbered parts (comma-separated list).The numbers for the parts can be seen from running mu extract
without any options but only the message file.
--target-dir=<dir>
save the parts in the target directory rather than the current working directory.
--overwrite
overwrite existing files with the same name; by default overwriting is not allowed.
--play Try to 'play' (open) the attachment with the default
application for the particular file type. On MacOS, this uses the open program, on other platforms is uses xdg-open. You can choose
a different program by setting the MU_PLAY_PROGRAM environment variable.
EXAMPLES
To display information about all the MIME-parts in a message file:
$ mu extract msgfile
To extract MIME-part 3 and 4 from this message, overwriting existing files with the same name:
$ mu extract --parts=3,4 --overwrite msgfile
To extract all files ending in '.jpg' (case-insensitive):
$ mu extract msgfile '.*.jpg'
To extract an mp3-file, and play it in the the default mp3-playing application.
$ mu extract --play msgfile 'whoopsididitagain.mp3'
BUGS
Please report bugs if you find them: http://code.google.com/p/mu0/issues/list
AUTHOR
Dirk-Jan C. Binnema <djcb@djcbsoftware.nl>
SEE ALSO mu(1)User Manuals February 2012 MU-EXTRACT(1)