Sponsored Content
Special Forums UNIX Desktop Questions & Answers How to concatenate consecutive lines Post 302275679 by shivi707 on Monday 12th of January 2009 12:33:29 AM
Old 01-12-2009
Question How to concatenate consecutive lines

I have a few lines like --

feature 1,
subfeat 0,
type 3,
subtype 1,
value 0,
--
feature 1,
subfeat 0,
type 1,
subtype 1,
value 0,

I would like to concatenate the consecutive four lines so that the output is --

feature 1,subfeat 0,type 3,subtype 1,value 0,
feature 1,subfeat 0,type 1,subtype 1,value 0,


Can anyone suggest a way to do that?
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Appending Consecutive lines

Hi, I have a file containing a single field on every row. What I need is to append one on to the end of another, e.g. The input file looks like this: nnnnn mmmmmm nnnnn mmmmmm I need it to look like this: nnnnn mmmmmm nnnnn mmmmmm Any ideas would be much appreciated,... (8 Replies)
Discussion started by: pondlife
8 Replies

2. UNIX for Dummies Questions & Answers

want to merge two consecutive lines.

Hi All, I want to merge two consecutive lines. Currently the output is :--> crmplp1 cmis461 No Online cmis462 No Offline crmplp2 cmis462 No Online cmis463 No ... (6 Replies)
Discussion started by: pank29
6 Replies

3. Shell Programming and Scripting

concatenate consecutive field values

Hi, I have a file like this A Bob A Sam A John B David C Paul C Sandra If the consecutive field values in column one is same, then concatenate the corresponding strings. So, I need an output like this, A Bob_Sam_John B David C Paul_Sandra I usually work with excel but... (3 Replies)
Discussion started by: polsum
3 Replies

4. Shell Programming and Scripting

look for two consecutive lines in all text files

How to get (a list of) all the text files in the current directory and subdirectories which has the following two consecutive lines: ctrl_end_date=2009 ctrl_process=EXPIRED OR ctrl_end_date=2010 ctrl_process=EXPIRED i.e. (ctrl_end_date=2009 OR ctrl_end_date=2010) AND ctrl_process=EXPIRED... (6 Replies)
Discussion started by: albertkao
6 Replies

5. Shell Programming and Scripting

Concatenate lines between lines starting with a specific pattern

Hi, I have a file such as: --- >contig00001 length=35524 numreads=2944 gACGCCGCGCGCCGCGGCCAGGGCTGGCCCA CAGGCCGCGCGGCGTCGGCTGGCTGAG >contig00002 length=4242 numreads=43423 ATGCCGAAGGTCCGCCTGGGGCTGG CGCCGGGAGCATGTAGCG --- I would like to concatenate the lines not starting with ">"... (9 Replies)
Discussion started by: s052866
9 Replies

6. Shell Programming and Scripting

Merge two non-consecutive lines

Hello - First post here. I need help combining two lines that are non-consecutive in a file. Using sed, awk or perl preferably. So the file looks as follows. Please note, the "Line#:" is there only for reference. The lines can only be distinguished by whether they have "start" or "done" in... (2 Replies)
Discussion started by: munkee
2 Replies

7. Shell Programming and Scripting

Grep couple of consecutive lines if each lines contains certain string

Hello, I want to extract from a file like : 20120530025502914 | REQUEST | whatever 20120530025502968 | RESPONSE | whatever 20120530025502985 | RESPONSE | whatever 20120530025502996 | REQUEST | whatever 20120530025503013 | REQUEST | whatever 20120530025503045 | RESPONSE | whatever I want... (14 Replies)
Discussion started by: black_fender
14 Replies

8. UNIX for Dummies Questions & Answers

Delete 26 consecutive lines in a file

I have a text file that is about 90,000 lines long. How would I delete lines 64-89, 152-177, 240-265, 328-353... etc? The sections I would like to delete are 26 lines long and the number of lines between the sections I would like to delete is 62 lines. Thanks very much in advance. (6 Replies)
Discussion started by: MDeBiasse
6 Replies

9. UNIX for Dummies Questions & Answers

Eliminate consecutive lines with the same pattern

Hi, I would like to know how to remove lines which has the same pattern as the next line through sed/awk. Stream 39 (wan stream 7) Stream 40 (wan stream 8) WINQ Counter 115955 1 1613 (BYTE) 11204787 163 ... (2 Replies)
Discussion started by: sarn_nat
2 Replies

10. Shell Programming and Scripting

Grep three consecutive lines if each lines contains certain string

say we have : 2914 | REQUEST | whatever 2914 | RESPONSE | whatever 2914 | SUCCESS | whatever 2985 | RESPONSE | whatever 2986 | REQUEST | whatever 2990 | REQUEST | whatever 2985 | RESPONSE | whatever 2996 | REQUEST | whatever 2010 | SUCCESS | whatever 2013 | REQUEST | whatever 2013 |... (7 Replies)
Discussion started by: Saumitra Pandey
7 Replies
IMAP_FETCHSTRUCTURE(3)							 1						    IMAP_FETCHSTRUCTURE(3)

imap_fetchstructure - Read the structure of a particular message

SYNOPSIS
object imap_fetchstructure (resource $imap_stream, int $msg_number, [int $options]) DESCRIPTION
Fetches all the structured information for a given message. PARAMETERS
o $ imap_stream -An IMAP stream returned by imap_open(3). o $msg_number - The message number o $options - This optional parameter only has a single option, FT_UID, which tells the function to treat the $msg_number argument as a UID. RETURN VALUES
Returns an object includes the envelope, internal date, size, flags and body structure along with a similar object for each mime attach- ment. The structure of the returned objects is as follows: Returned Objects for imap_fetchstructure(3) +--------------+---------------------------------------------------+ | type | | | | | | | Primary body type | | | | | encoding | | | | | | | Body transfer encoding | | | | | ifsubtype | | | | | | | | | | TRUE if there is a subtype string | | | | | subtype | | | | | | | MIME subtype | | | | |ifdescription | | | | | | | | | | TRUE if there is a description string | | | | | description | | | | | | | Content description string | | | | | ifid | | | | | | | | | | TRUE if there is an identification string | | | | | id | | | | | | | Identification string | | | | | lines | | | | | | | Number of lines | | | | | bytes | | | | | | | Number of bytes | | | | |ifdisposition | | | | | | | | | | TRUE if there is a disposition string | | | | | disposition | | | | | | | Disposition string | | | | |ifdparameters | | | | | | | | | | TRUE if the $dparameters array exists | | | | | dparameters | | | | | | | An array of objects where each object has an | | | "attribute" and a "value" property corresponding | | | to the parameters on the Content-dispositionMIME | | | header. | | | | |ifparameters | | | | | | | | | | TRUE if the parameters array exists | | | | | parameters | | | | | | | An array of objects where each object has an | | | "attribute" and a "value" property. | | | | | parts | | | | | | | An array of objects identical in structure to the | | | top-level object, each of which corresponds to a | | | MIME body part. | | | | +--------------+---------------------------------------------------+ Primary body type (may vary with used library) +--+-------------+ |0 | | | | | | | text | | | | |1 | | | | | | | multipart | | | | |2 | | | | | | | message | | | | |3 | | | | | | | application | | | | |4 | | | | | | | audio | | | | |5 | | | | | | | image | | | | |6 | | | | | | | video | | | | |7 | | | | | | | other | | | | +--+-------------+ Transfer encodings (may vary with used library) +--+------------------+ |0 | | | | | | | 7BIT | | | | |1 | | | | | | | 8BIT | | | | |2 | | | | | | | BINARY | | | | |3 | | | | | | | BASE64 | | | | |4 | | | | | | | QUOTED-PRINTABLE | | | | |5 | | | | | | | OTHER | | | | +--+------------------+ SEE ALSO
imap_fetchbody(3), imap_bodystruct(3). PHP Documentation Group IMAP_FETCHSTRUCTURE(3)
All times are GMT -4. The time now is 08:51 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy