Sponsored Content
Full Discussion: File Operations
Top Forums Shell Programming and Scripting File Operations Post 303033519 by nikhil jain on Sunday 7th of April 2019 11:32:55 AM
Old 04-07-2019
File Operations

Hi Folks,

Below is example of an Input data which is used, based on the last 2, 3 & 4 column, I want my first column data to be collated as shown in the output section.


Code:
a,ac,tc,ic
b,ac,tc,ic
c,ac,tc,ic
d,ac,tc,ic
b,bc,tc,ic
d,bc,tc,ic
e,bc,tc,ic

I want my output to be

Code:
a,b,c,d##ac,tc,ic
b,d,e##bc,tc,ic


Last edited by nikhil jain; 04-07-2019 at 12:52 PM..
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

File operations

Hi there, I want some help on scripting regarding file processing. I have a scenario in which I have 10 files. (file1.txt, file2.txt....) and they are in paricular format. I want to read these files and append some text lines at the begining of each file and write this updated contents of... (2 Replies)
Discussion started by: chiragmistry21
2 Replies

2. UNIX for Dummies Questions & Answers

File operations

Hi I have a tab delimited file with 3 fields. I need to sort this file on the first field and remove all the records where the first field has dulplicates. For eg my file is 133|arrfdfdg|sdfdsg 234|asfsdgfs|aasdfs 133|affbfsde|dgfg When this file gets sorted I need the result to be ... (2 Replies)
Discussion started by: monks
2 Replies

3. Shell Programming and Scripting

Unix file operations(shell script)

Hi, I want to compare two files. Files will look like as follows: file1: ASDFGHJU|1234567890123456 QWERTYUI|3456789098900890 file2: ZXCVBVNM|0987654321234567 POLKIJUYH|1234789060985478 output file should be: ASDFGHJU|1234567890123456 QWERTYUI|3456789098900890 Thnaks in advance (6 Replies)
Discussion started by: nivas
6 Replies

4. Shell Programming and Scripting

Unix File operations

Hi, Iam having the two files as follows: file1: ASQWEDFR09876543121234512 POIUYTREW09876512345676788 ZXCVBNMKS1209888888888888 file2: ASQWEDFR09876543121234516 asdcvfgbtg@abc.com 0000000-90-1239--2008 8990---- CXADFGTU09876543121234789 asdcvfgbtg@abc.com ... (14 Replies)
Discussion started by: nivas
14 Replies

5. Shell Programming and Scripting

file operations in shell scripting

hi All, my query... 1.I Have to search for the files in the root directory. 2.i have to search for a pattern in all the files in the root directory and then replace them with a new pattern. 3.Rename the file Explanation: if ABC is the root folder and has 3 subfolders and there are 15... (9 Replies)
Discussion started by: adityamahi
9 Replies

6. UNIX for Dummies Questions & Answers

arithmetic operations on 1 column of a file

Hi, I have a file with thousands of lines like this: Chr1 477515 . ACCCC ACCC 17.7 . INDEL;DP=17;AF1=1;CI95=0.5,1;DP4=0,1,0,3;MQ=32;PV4=1,0.036,1,1 Chr1 481987 . A AAAT 62 . INDEL;DP=11;AF1=1;CI95=0.5,1;DP4=0,0,1,3;MQ=41 I want to make a file with... (2 Replies)
Discussion started by: fadista
2 Replies

7. Shell Programming and Scripting

Perform Operations on One File Conditional on Data in Another File

Hello all, I am looking for a solution to the following problem. Perl or python solutions also welcome. Given this input: And this input: I want to get this output. The rule being that if the number in the first file is < 0.9, then the corresponding two columns on... (2 Replies)
Discussion started by: hydrabane
2 Replies

8. Shell Programming and Scripting

How to search and append words in the same file using unix scripting file operations

Hi , I have a file myhost.txt which contains below, 127.0.0.1 localhost 1.17.1.5 atrpx958 11.17.10.11 atrpx958zone nsybhost I need to append words only after "atrpx958" like 'myhost' and 'libhost' and not after atrpx958zone. How to search the word atrpx958(which is hostname) only,... (5 Replies)
Discussion started by: gsreeni
5 Replies

9. Programming

File operations in C pgm

i am reading and writing to a a file in C language. the input file is described as follows 111 aaa descr1 222 bbb descr2 333 ccc <SPACE> {6 spaces are left after ccc i.e in 3rd column} 444 ddd descr4 when i read and write to a file, the space is not coming in the output file.... (8 Replies)
Discussion started by: vkca
8 Replies

10. Shell Programming and Scripting

Operations inside a file

Hi all, i need to do a piecewise integration between this example data inside a file : 500856704.00 11536282.5600897 50496 500402784.00 11538000.3654401 -453920 500654880.00 11538000.4662785 252096 500604416.00 11539718.4330113 -50464 500907168.00 11539718.5541121 302752 500705280.00... (3 Replies)
Discussion started by: Board27
3 Replies
SLAPD-SHELL(5)                                                  File Formats Manual                                                 SLAPD-SHELL(5)

NAME
slapd-shell - Shell backend to slapd SYNOPSIS
/etc/ldap/slapd.conf DESCRIPTION
The Shell backend to slapd(8) executes external programs to implement operations, and is designed to make it easy to tie an existing data- base to the slapd front-end. This backend is primarily intended to be used in prototypes. WARNING
The abandon shell command has been removed since OpenLDAP 2.1. CONFIGURATION
These slapd.conf options apply to the SHELL backend database. That is, they must follow a "database shell" line and come before any subse- quent "backend" or "database" lines. Other database options are described in the slapd.conf(5) manual page. These options specify the pathname and arguments of the program to execute in response to the given LDAP operation. Each option is fol- lowed by the input lines that the program receives: add <pathname> <argument>... ADD msgid: <message id> <repeat { "suffix:" <database suffix DN> }> <entry in LDIF format> bind <pathname> <argument>... BIND msgid: <message id> <repeat { "suffix:" <database suffix DN> }> dn: <DN> method: <method number> credlen: <length of <credentials>> cred: <credentials> compare <pathname> <argument>... COMPARE msgid: <message id> <repeat { "suffix:" <database suffix DN> }> dn: <DN> <attribute>: <value> delete <pathname> <argument>... DELETE msgid: <message id> <repeat { "suffix:" <database suffix DN> }> dn: <DN> modify <pathname> <argument>... MODIFY msgid: <message id> <repeat { "suffix:" <database suffix DN> }> dn: <DN> <repeat { <"add"/"delete"/"replace">: <attribute> <repeat { <attribute>: <value> }> - }> modrdn <pathname> <argument>... MODRDN msgid: <message id> <repeat { "suffix:" <database suffix DN> }> dn: <DN> newrdn: <new RDN> deleteoldrdn: <0 or 1> <if new superior is specified: "newSuperior: <DN>"> search <pathname> <argument>... SEARCH msgid: <message id> <repeat { "suffix:" <database suffix DN> }> base: <base DN> scope: <0-2, see ldap.h> deref: <0-3, see ldap.h> sizelimit: <size limit> timelimit: <time limit> filter: <filter> attrsonly: <0 or 1> attrs: <"all" or space-separated attribute list> unbind <pathname> <argument>... UNBIND msgid: <message id> <repeat { "suffix:" <database suffix DN> }> dn: <bound DN> Note that you need only supply configuration lines for those commands you want the backend to handle. Operations for which a command is not supplied will be refused with an "unwilling to perform" error. The search command should output the entries in LDIF format, each entry followed by a blank line, and after these the RESULT below. All commands except unbind should then output: RESULT code: <integer> matched: <matched DN> info: <text> where only the RESULT line is mandatory. Lines starting with `#' or `DEBUG:' are ignored. ACCESS CONTROL
The shell backend does not honor all ACL semantics as described in slapd.access(5). In general, access to objects is checked by using a dummy object that contains only the DN, so access rules that rely on the contents of the object are not honored. In detail: The add operation does not require write (=w) access to the children pseudo-attribute of the parent entry. The bind operation requires auth (=x) access to the entry pseudo-attribute of the entry whose identity is being assessed; auth (=x) access to the credentials is not checked, but rather delegated to the underlying shell script. The compare operation requires read (=r) access (FIXME: wouldn't compare (=c) be a more appropriate choice?) to the entry pseudo-attribute of the object whose value is being asserted; compare (=c) access to the attribute whose value is being asserted is not checked. The delete operation does not require write (=w) access to the children pseudo-attribute of the parent entry. The modify operation requires write (=w) access to the entry pseudo-attribute; write (=w) access to the specific attributes that are modi- fied is not checked. The modrdn operation does not require write (=w) access to the children pseudo-attribute of the parent entry, nor to that of the new par- ent, if different; write (=w) access to the distinguished values of the naming attributes is not checked. The search operation does not require search (=s) access to the entry pseudo_attribute of the searchBase; search (=s) access to the attributes and values used in the filter is not checked. EXAMPLE
There is an example search script in the slapd/back-shell/ directory in the OpenLDAP source tree. LIMITATIONS
The shell backend does not support threaded environments. When using the shell backend, slapd(8) should be built --without-threads. FILES
/etc/ldap/slapd.conf default slapd configuration file SEE ALSO
slapd.conf(5), slapd(8), sh(1). OpenLDAP 2012/04/23 SLAPD-SHELL(5)
All times are GMT -4. The time now is 05:28 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy