Sponsored Content
Top Forums Shell Programming and Scripting Conditional removing of words from a line Post 302533942 by gaur.deepti on Saturday 25th of June 2011 08:57:42 PM
Old 06-25-2011
Conditional removing of words from a line

Hi ,

I have a .csv file,from which I want to remove some data from each column as below.

Code:
Source Data

GT_12_AUDIT,SCHEDULED,NOZOMI2010/GT_12_AUDIT,CTSCAN/Zh_GT_6547887/GT_12_AUDIT,CTSCAN/Zh_GT_6547887
GT_12_13_AUDIT,SCHEDULED,NOZOMI2010/GT_12_13_AUDIT,XRAY/XT_TH_6987458/GT_12_13_AUDIT,XRAY/Zh_GT_6547887
GT_12_13_VISITED,SCHEDULED,NOZOMI2010/GT_12_13_VISITED,XRAY/XT_TH_6987458/GT_12_13_VISITED,XRAY/Zh_GT_6547887


Code:
Target Data

AUDIT,SCHEDULED,NOZOMI2010/AUDIT,CTSCAN/Zh_GT_6547887/AUDIT,CTSCAN/Zh_GT_6547887
AUDIT,SCHEDULED,NOZOMI2010/AUDIT,XRAY/XT_TH_6987458/AUDIT,XRAY/Zh_GT_6547887
VISITED,SCHEDULED,NOZOMI2010/VISITED,XRAY/XT_TH_6987458/VISITED,XRAY/Zh_GT_6547887

I really don't have any clue on how to do this, please give me some logic to do the same.

Regards,Deepti
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Removing uppercase words from textfiles

I have the task of removing all uppercase words from csv files, mit 10000's lines. I think it shoud be possible with regex's, something like "s/{2,}//g" but I can't get it work with sed or Vi. It would also be possible to script in ksh, awk, perl or python. example this "this is a EXAMPLE... (5 Replies)
Discussion started by: frieling
5 Replies

2. Shell Programming and Scripting

Copying x words from end of line to specific location in same line

Hello all i know it is pretty hard one but you will manage it all after noticing and calculating i find a rhythm for the file i want to edit to copy the last 12 characters in line but the problem is to add after first 25 characters in same line in other way too copy the last 12 characters... (10 Replies)
Discussion started by: princesasa
10 Replies

3. Shell Programming and Scripting

removing 2 words from file.

Hi All, I have a text file with name of source files in that. source files ends with .mxml and .css. Now I want to remove the extensions of these source files. Currently I can do so by writing 2 sed commands, as there are files with just 2 different extensions. But I want to do it in one sed... (6 Replies)
Discussion started by: mkashif
6 Replies

4. Shell Programming and Scripting

Removing identical words in column

I have a file that needs to be cleaned up. Here is the file: Project Project John Project Gary Project Sean Project2 Project2 Lisa Project2 Tyler Project2 Sam Project3 Project3 Mike Project3 Bran I need the o/p to be: Project John Gary Sean Project2 (7 Replies)
Discussion started by: leepet01
7 Replies

5. Shell Programming and Scripting

finding and removing 2 identical consecutive words in a text

i want to write a shell script that correct a text file.for example if i have the input file: "john has has 2 apples anne has 3 oranges oranges" i want that the output file be like this: "john has 2 apples anne has 3 oranges" i've tried to read line by line from input text file into array... (11 Replies)
Discussion started by: cocostaec
11 Replies

6. Shell Programming and Scripting

conditional append one line in file.

Hi, Unix gurus, I have a requirement as following: checking existing file, if the file only contain one line. then append "No data" else keep existing file as is. can i achieve this by in command line without write a script. :wall: Thanks in advance. (4 Replies)
Discussion started by: ken002
4 Replies

7. Shell Programming and Scripting

removing the words with symbols in a file in unix

I have file like below Hi iam author <br>joseph</br> in france. I live in my home <br></br> but no food. I will play footbal <br></br> but i wont play cricket. I will read all the books <br>all fiction stories</br> i hate horror stories. I want output like below Hi iam author... (3 Replies)
Discussion started by: vinothsekark
3 Replies

8. Shell Programming and Scripting

sed conditional \n replace for each line

How could be removed \n only if appearing at position 80 in the line? (4 Replies)
Discussion started by: RomanF
4 Replies

9. Shell Programming and Scripting

Add words in beginning , end after removing a word in a file

My file has the entries like below... /dev/sds /dev/sdak /dev/sdbc /dev/sdbu I want to make the file like below echo 1 > /sys/block/sds/device/rescan echo 1 > /sys/block/sdak/device/rescan echo 1 > /sys/block/sdbc/device/rescan echo 1 > /sys/block/sdbu/device/rescan (2 Replies)
Discussion started by: saravanapandi
2 Replies

10. Shell Programming and Scripting

Replace particular words in file based on if finds another words in that line

Hi All, I need one help to replace particular words in file based on if finds another words in that file . i.e. my self is peter@king. i am staying at north sydney. we all are peter@king. How to replace peter to sham if it finds @king in any line of that file. Please help me... (8 Replies)
Discussion started by: Rajib Podder
8 Replies
AUDIT(4)						   BSD Kernel Interfaces Manual 						  AUDIT(4)

NAME
audit -- Security Event Audit SYNOPSIS
options AUDIT DESCRIPTION
Security Event Audit is a facility to provide fine-grained, configurable logging of security-relevant events, and is intended to meet the requirements of the Common Criteria (CC) Common Access Protection Profile (CAPP) evaluation. The FreeBSD audit facility implements the de facto industry standard BSM API, file formats, and command line interface, first found in the Solaris operating system. Information on the user space implementation can be found in libbsm(3). Audit support is enabled at boot, if present in the kernel, using an rc.conf(5) flag. The audit daemon, auditd(8), is responsible for con- figuring the kernel to perform audit, pushing configuration data from the various audit configuration files into the kernel. Audit Special Device The kernel audit facility provides a special device, /dev/audit, which is used by auditd(8) to monitor for audit events, such as requests to cycle the log, low disk space conditions, and requests to terminate auditing. This device is not intended for use by applications. Audit Pipe Special Devices Audit pipe special devices, discussed in auditpipe(4), provide a configurable live tracking mechanism to allow applications to tee the audit trail, as well as to configure custom preselection parameters to track users and events in a fine-grained manner. SEE ALSO
auditreduce(1), praudit(1), audit(2), auditctl(2), auditon(2), getaudit(2), getauid(2), poll(2), select(2), setaudit(2), setauid(2), libbsm(3), auditpipe(4), audit.log(5), audit_class(5), audit_control(5), audit_event(5), audit_user(5), audit_warn(5), rc.conf(5), audit(8), auditd(8), auditdistd(8) HISTORY
The OpenBSM implementation was created by McAfee Research, the security division of McAfee Inc., under contract to Apple Computer Inc. in 2004. It was subsequently adopted by the TrustedBSD Project as the foundation for the OpenBSM distribution. Support for kernel audit first appeared in FreeBSD 6.2. AUTHORS
This software was created by McAfee Research, the security research division of McAfee, Inc., under contract to Apple Computer Inc. Addi- tional authors include Wayne Salamon, Robert Watson, and SPARTA Inc. The Basic Security Module (BSM) interface to audit records and audit event stream format were defined by Sun Microsystems. This manual page was written by Robert Watson <rwatson@FreeBSD.org>. BUGS
The FreeBSD kernel does not fully validate that audit records submitted by user applications are syntactically valid BSM; as submission of records is limited to privileged processes, this is not a critical bug. Instrumentation of auditable events in the kernel is not complete, as some system calls do not generate audit records, or generate audit records with incomplete argument information. Mandatory Access Control (MAC) labels, as provided by the mac(4) facility, are not audited as part of records involving MAC decisions. BSD
May 31, 2009 BSD
All times are GMT -4. The time now is 07:38 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy