Sponsored Content
Top Forums Shell Programming and Scripting Sed: delete on each line before a character and after a character Post 302771856 by elixir_sinari on Thursday 21st of February 2013 08:30:15 PM
Old 02-21-2013
Quote:
Originally Posted by bipinajith
Code:
sed 's/.*[(]//; s/[)].*//' file

The parens are not required to be put in bracket expressions.
This User Gave Thanks to elixir_sinari For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Use sed to delete a character

I built a 12 million record file and made a mistake, one field is 1 character too long. The record is 40 bytes and ends always in 999. I am trying to delete the 37 character in each record. Is this possible without doing a cut and paste. (1 Reply)
Discussion started by: bthomas
1 Replies

2. Shell Programming and Scripting

How to delete last character of a line?

Hello, I think I'm close to doing this, but I could be wrong. I have a string I would like to search for and delete the last character of the that line. This is what I have... sed 's/POHEAD\(.\)$//g' tempd > tempe The above works if I search for P, but that won't work. I need to search... (2 Replies)
Discussion started by: ctcuser
2 Replies

3. Shell Programming and Scripting

how to delete space character with sed

hi all, i want to delete a space character in word on unix script with command sed like : #dia n result: #dian is there anyone will help me ? regards, cahyo (1 Reply)
Discussion started by: cahyo3074
1 Replies

4. UNIX for Dummies Questions & Answers

Delete between 10th character and 20th character

Hi, I have a .txt and I need to delete the characters betwwen the 10th and 20th... How can I do that... I need to do somethink like these: %s/I don't know how to define a range between 10th and 20th character//g Can you help me... If I want the 10 first characters i do this:... (2 Replies)
Discussion started by: nuno_fbo
2 Replies

5. Shell Programming and Scripting

script to delete character in a line

Hi, Please help me to edit a file, with the following changes, 1) serach for XYZ , appears at the start of line, delete a character present in specified column number in a line. 2) This needs to be repeated in multiple rows and not the entire file Thanks (1 Reply)
Discussion started by: abc_81
1 Replies

6. Shell Programming and Scripting

sed to delete character 0 only when it's on its own?

Hi all I am trying to get my head around doing the following.... I have an input field that could contain either a number a blank field or a whitespace field. What I want to do is delete a 0 (zero) if it's on its own or leading the number. So:- \t0 delete the zero 0 delete the... (8 Replies)
Discussion started by: Bashingaway
8 Replies

7. Shell Programming and Scripting

sed or awk delete character in the lines before and after the matching line

Sample file: This is line one, this is another line, this is the PRIMARY INDEX line l ; This is another line The command should find the line with “PRIMARY INDEX” and remove the last character from the line preceding it (in this case , comma) and remove the first character from the line... (5 Replies)
Discussion started by: KC_Rules
5 Replies

8. Shell Programming and Scripting

How to delete a character using sed and or awk?

Hi, 1/ i have file test.txt 1 Jul 28 08:35:29 2014-07-28 Root::UserA 1 Jul 28 08:36:44 2014-07-28 Root::UserB i want to delete the seconds of the file, and the Root:: and the output will be: 1 Jul 28 08:35 2014-07-28 UserA 1 Jul 28 08:36 2014-07-28 UserB 2/i have another file test2.txt:... (8 Replies)
Discussion started by: fxsme
8 Replies

9. Shell Programming and Scripting

sed searches a character string for a specified delimiter character, and returns a leading or traili

Hi, Anyone can help using SED searches a character string for a specified delimiter character, and returns a leading or trailing space/blank. Text file : "1"|"ExternalClassDEA519CF5"|"Art1" "2"|"ExternalClass563EA516C"|"Art3" "3"|"ExternalClass305ED16B8"|"Art9" ... ... ... (2 Replies)
Discussion started by: fspalero
2 Replies

10. Shell Programming and Scripting

Count specific character of a file in each line and delete this character in a specific position

I will appreciate if you help me here in this script in Solaris Enviroment. Scenario: i have 2 files : 1) /tmp/TRANSACTIONS_DAILY_20180730.txt: 201807300000000004 201807300000000005 201807300000000006 201807300000000007 201807300000000008 2)... (10 Replies)
Discussion started by: teokon90
10 Replies
delete directory(1m)													      delete directory(1m)

NAME
delete directory - Deletes a directory SYNOPSIS
cdscp delete directory directory-name ARGUMENTS
The full name of the directory. DESCRIPTION
The delete directory command deletes a directory. The directory cannot contain any object entries, soft links, or child pointers. The master replica must be the only remaining replica in the cell. Use the delete replica command if you need to remove read-only replicas. Privilege Required You must have delete permission to the directory and write permission to the clearinghouse that stores the master replica of the directory. The server principal needs administer permission to the parent directory or delete permission to the child pointer that points to the directory you intend to delete. NOTE
This command is replaced at Revision 1.1 by the dcecp command and may not be provided in future releases of DCE. EXAMPLE
The following command deletes the directory /.:/eng from the namespace: cdscp> delete directory /.:/eng RELATED INFORMATION
Commands: create directory(1m), delete replica(1m), list directory(1m), set directory(1m), set directory to skulk(1m), show directory(1m) delete directory(1m)
All times are GMT -4. The time now is 01:09 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy