Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Please Help:Need to Split the file into mutliple files depends on the KEY field value Post 302186214 by arund_01 on Wednesday 16th of April 2008 05:11:01 PM
Old 04-16-2008
Hi Era,

Thanks for the help. but requirment is little bit different. you have given example for a single value search, but i want to search multiple values in given files and put result into single file.

waiting for your response.

Thanks
Arun
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Split file based on field

Hi I have a large file 2.6 million records and I am trying to split the file based on last column. I am doing awk -F"|" '{ print > $NF }' filename1 After around 1000 splits it gives me a error awk: can't open file 3332332423 input record number 1068, file filename1 source... (6 Replies)
Discussion started by: s_adu
6 Replies

2. Shell Programming and Scripting

split large file based on field criteria

I have a file containing date/time sorted data of the form ... 2009/06/10,20:59:59.950,XAG/USD,Q,1,1115, 14.3025,100,1,1 2009/06/10,20:59:59.950,XAG/USD,Q,1,1116, 14.3026,125,1,1 2009/06/10,20:59:59.950,XAG/USD,R,0,0, , 0,0,0 2009/06/10,20:59:59.950,XAG/USD,R,1,0, 14.1910,100,1,1... (6 Replies)
Discussion started by: asriva
6 Replies

3. Shell Programming and Scripting

Split file when the key field change !

Hello, I have the following example data file: Rv.Global_Sk,1077.160523,D,16/09/2011 Rv.Global_Sk,1077.08098,D,17/09/2011 Rv.Global_Sk,1077.001445,D,18/09/2011 Rv.Global_Sk,1072.660733,D,19/09/2011 Rv.Global_Sk,1070.381557,D,20/09/2011 Rv.Global_Sk,1071.971747,D,21/09/2011... (4 Replies)
Discussion started by: csierra
4 Replies

4. Shell Programming and Scripting

awk to split one field and print the last two fields within the split part.

Hello; I have a file consists of 4 columns separated by tab. The problem is the third fields. Some of the them are very long but can be split by the vertical bar "|". Also some of them do not contain the string "UniProt", but I could ignore it at this moment, and sort the file afterwards. Here is... (5 Replies)
Discussion started by: yifangt
5 Replies

5. Shell Programming and Scripting

Split a file into multiple files based on field value

Hi, I've one requirement. I have to split one comma delimited file into multiple files based on one of the column values. How can I achieve this Unix Here is the sample data. In this case I have split the files based on date column(c4) Input file c1,c2,c3,c4,c5... (1 Reply)
Discussion started by: manasvi24
1 Replies

6. Shell Programming and Scripting

How to split file into multiple files using awk based on 1 field in the file?

Good day all I need some helps, say that I have data like below, each field separated by a tab DATE NAME ADDRESS 15/7/2012 LX a.b.c 15/7/2012 LX1 a.b.c 16/7/2012 AB a.b.c 16/7/2012 AB2 a.b.c 15/7/2012 LX2 a.b.c... (2 Replies)
Discussion started by: alexyyw
2 Replies

7. UNIX for Dummies Questions & Answers

Split a file into parts only if the first field is different

Hi, I have a file like this: aaa 123 aaa 223 aaa 225 bbb 332 bbb 423 bbb 6755 bbb 324 ccc 112 ccc 234 ccc 897 Which I need to split into several files, something like split -l 3 but the way that the lines with the same names would only go into one file: (7 Replies)
Discussion started by: coppuca
7 Replies

8. Shell Programming and Scripting

Split file based on a column/field value

Hi All, I have a requirement to split file into 2 sets of file. Below is a sample data of the file AU;PTN;24EX;25-AUG-14;AU;123;SE;123;Test NN;;;;ASD; AU;PTN;24EX;25-AUG-14;AU;456;SE;456;Test NN;;;;ASD; AU;PTN;24EX;25-AUG-14;AU;147;SE;147;Test NN;;;;ASD;... (6 Replies)
Discussion started by: galaxy_rocky
6 Replies

9. Shell Programming and Scripting

EBCDIC File Split Based On Record Key

I was wondering if anyone could explain to me how to split a variable length EBCDIC file into seperate files based on the record key. I have the COBOL layout, and so I need to split the file into 13 different EBCDIC files so that I can run each one through a C++ converter I have, and get the... (11 Replies)
Discussion started by: hanshot1stx
11 Replies

10. Shell Programming and Scripting

Update a specific field in file with Variable value based on other Key Word

I have an input file with A=xyz B=pqr I would want the value in Second Field (xyz or pqr) updated with a value present in Shell Variable based on the value passed in the first field. (A or B ) while read line do NEW_VALUE = `some functionality done on $line` If $line=First Field-... (1 Reply)
Discussion started by: infernalhell
1 Replies
ldap_result(3LDAP)					      LDAP Library Functions						ldap_result(3LDAP)

NAME
ldap_result, ldap_msgfree - wait for and return LDAP operation result SYNOPSIS
cc[ flag... ] file... -lldap[ library... ] #include <lber.h> #include <ldap.h> int ldap_result(LDAP *ld, int msgid, int all, struct bervalstruct timeval *timeout, LDAPMessage **result); int ldap_msgfree(LDAPMessage *msg); DESCRIPTION
The ldap_result() function is used to wait for and return the result of an operation previously initiated by one of the LDAP asynchronous operation functions , for example, ldap_search(3LDAP), and ldap_modify(3LDAP). Those functions all return -1 in case of error, and an invocation identifier upon successful initiation of the operation. The invocation identifier is picked by the library and is guaranteed to be unique across the LDAP session. It can be used to request the result of a specific operation from ldap_result() through the msgid parameter. The ldap_result() function will block or not, depending upon the setting of the timeout parameter. If timeout is not a null pointer, it specifies a maximum interval to wait for the selection to complete. If timeout is a null pointer, the select blocks indefinitely. To effect a poll, the timeout argument should be a non-null pointer, pointing to a zero-valued timeval structure. See select(3C) for further details. If the result of a specific operation is required, msgid should be set to the invocation identifier returned when the operation was initi- ated, otherwise LDAP_RES_ANY should be supplied. The all parameter only has meaning for search responses and is used to select whether a single entry of the search response should be returned, or all results of the search should be returned. A search response is made up of zero or more search entries followed by a search result. If all is set to 0, search entries will be returned one at a time as they come in, by means of separate calls to ldap_result(). If it is set to a non-zero value, the search response will only be returned in its entirety, that is, after all entries and the final search result have been received. Upon success, the type of the result received is returned and the result parameter will contain the result of the operation. This result should be passed to the LDAP parsing functions, (see ldap_first_entry(3LDAP)) for interpretation. The possible result types returned are: #define LDAP_RES_BIND 0x61L #define LDAP_RES_SEARCH_ENTRY 0x64L #define LDAP_RES_SEARCH_RESULT 0x65L #define LDAP_RES_MODIFY 0x67L #define LDAP_RES_ADD 0x69L #define LDAP_RES_DELETE 0x6bL #define LDAP_RES_MODRDN 0x6dL #define LDAP_RES_COMPARE 0x6fL The ldap_msgfree() function is used to free the memory allocated for a result by ldap_result() or ldap_search_s(3LDAP) functions. It takes a pointer to the result to be freed and returns the type of the message it freed. ERRORS
The ldap_result() function returns -1 on error and 0 if the specified timeout was exceeded. ATTRIBUTES
See attributes(5) for a description of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | |Availability |SUNWcsl (32-bit) | | |SUNWcslx (64-bit) | |Interface Stability |Committed | +-----------------------------+-----------------------------+ SEE ALSO
select(1), ldap(3LDAP), ldap_search(3LDAP) , attributes(5) NOTES
The ldap_result() function allocates memory for results that it receives. The memory can be freed by calling ldap_msgfree. SunOS 5.11 16 Aug 2007 ldap_result(3LDAP)
All times are GMT -4. The time now is 05:01 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy