04-25-2012
Quote:
Originally Posted by
bakunin
This will remove the comma only if it is followed by " )" and - even worse - will remove any comma followed by " )"
isn't that what he wants ?
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
hi,
I'm trying to use sed to erase everything, up to, and including, the first closing parenthesis. for example:
input: blah blah blah (aldj) test (dafs) test test.
output: test (dafs) test test.
how would i do this?
I was fooling around with the parenthesis, and i only got it to apply to... (5 Replies)
Discussion started by: gammaman
5 Replies
2. Shell Programming and Scripting
Hi All,
silly question that I'm sure is easy to answer for a more experienced coder...
I have a file called test.txt containing the following text...
need, to, break, this, line, into, individual, lines
using sed, I'd like to make the file look like this...
need
to
break
this
line... (5 Replies)
Discussion started by: newbie_coder
5 Replies
3. UNIX for Dummies Questions & Answers
Hi All,
i have a file test.txt as shown below,
1,test,test111
2,rest,rest222
i want to replace the commas by tab delimiter..,
it should be like,
1 test test111
2 rest rest222
i tried the following code,
sed 's/,/\\t/g' test.txt >> ouptut.txt (9 Replies)
Discussion started by: Serious Sam
9 Replies
4. Shell Programming and Scripting
I wanted to change 34.66 to 34,66.
I tried the command: sed 's/./,/' $NUM
Where $NUM is a variable with 34.66 value.
The output is ,4.66 (2 Replies)
Discussion started by: bdalmeida
2 Replies
5. Shell Programming and Scripting
hi
i want to replace spaces by comma
my file is
ADD 16428 170 160 3 WNPG 204 941 No 204802
ADD 16428 170 160 3 WNPG 204 941 No 204803
ADD 16428 170 160 3 WNPG 204 941 No 204804
ADD... (9 Replies)
Discussion started by: raghavendra.cse
9 Replies
6. Shell Programming and Scripting
Hi,
How can I replace the 6th comma on each line (of a csv) with a space?
Any online tutorials with plenty of examples using sed would be very useful.
Alex (2 Replies)
Discussion started by: mcclunyboy
2 Replies
7. Shell Programming and Scripting
In a LaTeX manuscript, I need to replace many occurrences of
\emph{some string}
with some string, i.e. whatever string is inside. The string inside often may extend over several lines, and there may be other occurences of curly brackets inside it. So for example
\emph{this \it{is} a... (5 Replies)
Discussion started by: sune
5 Replies
8. UNIX for Advanced & Expert Users
Hi All,
Could some one help me on one of my requirement below:
I have a sequential file with 4fields in it and it is a comma (,) seperated file.
Delimeter is 'comma'.
But in of the file column for ex: 3rd column it is 'Description' (column name) I am getting the values with commas.... (6 Replies)
Discussion started by: eskay_s
6 Replies
9. UNIX for Dummies Questions & Answers
I have a huge file
which is pipe delimiter and i want to replace the pipe delimiter to a comma
Please Help as its v urgent.
Ex: parent|child|alias|....Heading of the file...and the data is of similar structure. (4 Replies)
Discussion started by: win4luv
4 Replies
10. Shell Programming and Scripting
I have the following data and want to put parenthis around the numbers:
PARTITION PERIOD_MIN VALUES LESS THAN 10649 TABLESPACE ODS_DAILY_MF_AUM,
PARTITION PERIOD_10649 VALUES LESS THAN 10650 TABLESPACE ODS_DAILY_MF_AUM,
PARTITION PERIOD_10650 VALUES LESS THAN 10651 TABLESPACE... (2 Replies)
Discussion started by: BeefStu
2 Replies
remove(3) Library Functions Manual remove(3)
NAME
remove - Removes a file
LIBRARY
Standard C Library (libc.so, libc.a)
SYNOPSIS
#include <stdio.h>
int remove( const char *path );
STANDARDS
Interfaces documented on this reference page conform to industry standards as follows:
remove(): POSIX.1, XPG4, XPG4-UNIX
Refer to the standards(5) reference page for more information about industry standards and associated tags.
PARAMETERS
Points to the file to be removed.
DESCRIPTION
The remove() function causes a file named by the pathname pointed to by path to be no longer accessible by that name. A subsequent attempt
to open that file using that name will fail unless it is created anew.
If the path parameter names a directory, remove(path) is equivalent to calling the rmdir() function on that directory. If path does not
name a directory, remove(path) is equivalent to unlink(path).
NOTES
If the file operated upon by the remove() function has multiple hard links, the link count in the file is decremented and only the speci-
fied file name is removed.
RETURN VALUES
Upon successful completion, the remove() function returns 0 (zero). Otherwise, a nonzero value is returned. Refer to the unlink() function
and the rmdir() function for information on return values.
ERRORS
Refer to the unlink() function and the rmdir() function for information on error conditions.
RELATED INFORMATION
Functions: link(2), rename(2), rmdir(2), unlink(2)
Standards: standards(5) delim off
remove(3)