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
ldap_get_lang_values(3LDAP)				      LDAP Library Functions				       ldap_get_lang_values(3LDAP)

NAME
ldap_get_lang_values, ldap_get_lang_values_len - return an attribute's values that matches a specified language subtype SYNOPSIS
cc -flag ... file ...-lldap [-library ...] #include <ldap.h> char **ldap_get_lang_values(LDAP *ld, LDAPMessage *entry, const char *target, char **type); struct berval **ldap_get_lang_values_len(LDAP *ld, LDAPMessage *entry, const char *target, char **type); DESCRIPTION
The ldap_get_lang_values() function returns an array of an attribute's string values that matches a specified language subtype. To retrieve the binary data from an attribute, call the ldap_get_lang_values_len() function instead. ldap_get_lang_values() should be called to retrieve a null-terminated array of an attribute's string values that match a specified language subtype. The entry parameter is the entry retrieved from the directory. The target parameter should contain the attribute type the values that are required, including the optional language subtype. The type parameter points to a buffer that returns the attribute type retrieved by this function. Unlike the ldap_get_values() function, if a language subtype is specified, this function first attempts to find and return values that match that subtype, for example, cn;lang-en. ldap_get_lang_values_len() returns a null-terminated array of pointers to berval structures, each containing the length and pointer to a binary value of an attribute for a given entry. The entry parameter is the result returned by ldap_result() or ldap_search_s() functions. The target parameter is the attribute returned by the call to ldap_first_attribute() or ldap_next_attribute(), or the attribute as a lit- eral string, such as jpegPhoto or audio. These functions are deprecated. Use ldap_get_values() or ldap_get_values_len() instead. RETURN VALUES
If successful, ldap_get_lang_values() returns a null-terminated array of the attribute's values. If the call is unsuccessful, or if no such attribute exists in the entry, it returns a NULL and sets the appropriate error code in the LDAP structure. The ldap_get_lang_values_len() function returns a null-terminated array of pointers to berval structures, which in turn, if successful, contain pointers to the attribute's binary values. If the call is unsuccessful, or if no such attribute exists in the entry, it returns a NULL and sets the appropriate error code in the LDAP structure. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWcsl (32-bit) | +-----------------------------+-----------------------------+ | |SUNWcslx (64-bit) | +-----------------------------+-----------------------------+ |Interface Stability |Obsolete | +-----------------------------+-----------------------------+ SEE ALSO
ldap_first_attribute(3LDAP), ldap_next_attribute(3LDAP), ldap_get_values(3LDAP), ldap_result(3LDAP), ldap_search_s(3LDAP), attributes(5) SunOS 5.10 25 Oct 2001 ldap_get_lang_values(3LDAP)
All times are GMT -4. The time now is 07:40 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy