Sponsored Content
Full Discussion: extract part of text file
Top Forums Shell Programming and Scripting extract part of text file Post 302428909 by waxo on Friday 11th of June 2010 08:34:08 AM
Old 06-11-2010
the end pattern is "--" because the following numbers change every time.

Smilie

---------- Post updated at 07:34 AM ---------- Previous update was at 07:27 AM ----------

Quote:
Originally Posted by bartus11
Code:
awk '/Content-Type: text\/plain; charset=ISO-8859-1/,/--/' infile

Content-Type: text/plain; charset=ISO-8859-1

this text can be
1 or more lines
like this


--001485f1ea946fb0b20488b1e401

It works! but I need only the text and no the patterns.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Moving part of Text in a file

Hi, I have this text in a file where I need to move part of the text.... <Relation1 OriginatingObjectID="Holding_1" RelatedObjectID="Party_1" id="Relation_1"> <OriginatingObjectType tc="4">Holding</OriginatingObjectType> <RelatedObjectType tc="6">Party</RelatedObjectType>... (4 Replies)
Discussion started by: mgirinath
4 Replies

2. UNIX for Dummies Questions & Answers

Extract a part of file name

Hi, I want to extract a part of filename and pass it as a parameter to one of the scripts. Could someone help. File name:- NLL_NAM_XXXXX.XXXXXXX_1_1.txt. Here i have to extract only XXXXX.XXXXXXX and the position will be constant. that means that i have to extract some n characters from... (6 Replies)
Discussion started by: dnat
6 Replies

3. Shell Programming and Scripting

How to extract certain part of log file?

Hi there, I'm having some problem with UNIX scripting (ksh), perhaps somebody can help me out? For example: ------------ Sample content of my log file (text file): -------------------------------------- File1: .... info_1 ... info_2 ... info_3 ... File2: .... info_1 ... info_2 ...... (10 Replies)
Discussion started by: superHonda123
10 Replies

4. Programming

c program to extract text between two delimiters from some text file

needa c program to extract text between two delimiters from some text file. and then storing them in to diffrent variables ? text file like 0: abc.txt ========= aaaaaa|11111111|sssssssssss|333333|ddddddddd|34343454564|asass aaaaaa|11111111|sssssssssss|333333|ddddddddd|34343454564|asass... (7 Replies)
Discussion started by: kukretiabhi13
7 Replies

5. Shell Programming and Scripting

extracting part of a text file

Hi guys So I have a very large log file where each event is logged along with the time that it occurred. So for e.g. The contents of the file look like: ... 12:00:07 event 0 happened. 12:01:01 event 1 happened. 12:01:05 event 2 happened. 12:01:30 event 3 happened. 12:02:01 event 4... (10 Replies)
Discussion started by: alinaqvi90
10 Replies

6. Shell Programming and Scripting

Extract part of file

Hello All, I need to extract part of a file into a new file My file is Define schema xxxxxx Insert into table ( a ,b ,c ,d ) values ( 1, 2, 3, (15 Replies)
Discussion started by: nnani
15 Replies

7. Shell Programming and Scripting

Extract the part of sequences from a file

I have a text file, input.fasta contains some protein sequences. input.fasta is shown below. >P02649 MKVLWAALLVTFLAGCQAKVEQAVETEPEPELRQQTEWQSGQRWELALGRFWDYLRWVQT LSEQVQEELLSSQVTQELRALMDETMKELKAYKSELEEQLTPVAEETRARLSKELQAAQA RLGADMEDVCGRLVQYRGEVQAMLGQSTEELRVRLASHLRKLRKRLLRDADDLQKRLAVY... (8 Replies)
Discussion started by: rahim42
8 Replies

8. Programming

Extract part of an archive to a different file

I need to save part of a file to a different one, start and end offset bytes are provided by two counters in long format. If the difference is big, how should I do it to prevent buffer overflow in java? (7 Replies)
Discussion started by: Tribe
7 Replies

9. Shell Programming and Scripting

Extract a part of variable/line content in a file

I have a variable and assigned the following values ***XYZ_201519_20150929140642_20150929140644_211_0_0_211 I need to read this variable from backward and stop read when I get first underscore (_) In this scenario I should get 211 Thanks Kris (3 Replies)
Discussion started by: mkris
3 Replies

10. Shell Programming and Scripting

Substr/Instr in shell script or extract part of text

Hi, I need to extract part of a text to two variables text is "PL/SQL procedure successfully completed. ERROR ----------------------------------------------------------------- Test Error Message PLUSVAR ---------- 1" I want "Test Error Message" in one variable and "1" in another variable.... (11 Replies)
Discussion started by: vedavrath
11 Replies
IMAP_MIME_HEADER_DECODE(3)						 1						IMAP_MIME_HEADER_DECODE(3)

imap_mime_header_decode - Decode MIME header elements

SYNOPSIS
array imap_mime_header_decode (string $text) DESCRIPTION
Decodes MIME message header extensions that are non ASCII text (see RFC2047). PARAMETERS
o $text - The MIME text RETURN VALUES
The decoded elements are returned in an array of objects, where each object has two properties, charset and text. If the element hasn't been encoded, and in other words is in plain US-ASCII, the charset property of that element is set to default. EXAMPLES
Example #1 imap_mime_header_decode(3) example <?php $text = "=?ISO-8859-1?Q?Keld_J=F8rn_Simonsen?= <keld@example.com>"; $elements = imap_mime_header_decode($text); for ($i=0; $i<count($elements); $i++) { echo "Charset: {$elements[$i]->charset} "; echo "Text: {$elements[$i]->text} "; } ?> The above example will output: Charset: ISO-8859-1 Text: Keld Jorn Simonsen Charset: default Text: <keld@example.com> In the above example we would have two elements, whereas the first element had previously been encoded with ISO-8859-1, and the second element would be plain US-ASCII. SEE ALSO
imap_utf8(3). PHP Documentation Group IMAP_MIME_HEADER_DECODE(3)
All times are GMT -4. The time now is 12:26 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy