Hello,
I have a file with many lines with below format:
\abc\\1234
jkl\\567
def\\345
\pqr\\567
\xyz\\234
Here, i need to do 2 things.
1. replace \\ with \
2. remove starting \
so output to be as below: (11 Replies)
Hi,
I am reading a file (GC_JAR.log) which has entries like:
511725.629, 0.1122672 secs]
525268.975, 0.1240036 secs]
527181.835, 0.2068215 secs]
527914.287, 0.2884801 secs]
528457.134, 0.2548725 secs]
I want to replace all the entries of "secs]" with just "secs"
Thus, the output... (4 Replies)
Hi everyone
I have file1 contains:
'7832'
' 8765
6543
I want a sed command that will format as:
'7832' , '8765' , '6543'
I tried
sed -e s/\'//g -e 's/^*//;s/*$//' file1 > file2
sed -e :a -e '$!N; s/\n/ /; ta' file2
which gives: 7832 8765 6543
I need some help to continue with... (5 Replies)
Hello All
Seeking the right one SED command.
My attempt is:
From orginal.txt by SED to target.txt
sed -i "/('outbound-callerid/a\$ext->add($context, $exten, '', new ext_SipAddHeader('P-Preferred-Identity', '<sip:${CALLERID(nummer)}@carrier.com>'));" orginal.txtWhat am make wrong?:wall:
... (5 Replies)
Need help in escaping special characters in sed command.
Here is the the string which i am trying to find a replace with
From :- REQUEST_TYPE=PIXEL&MSG_ID={//MESSAGE_ID}
To :- REQUEST_TYPE=PIXEL&MSG_ID= X_EDELIVERY_MESSAGE_ID & BATCH_ID= X_EDELIVERY_BATCH_ID
Here is the sed command i am... (2 Replies)
Hi I'm trying to replace string1 by string2 in file homepage.htm as follows but is not working. Please Help:
sedsed -i "s@'://your server name:port/test/owa'@'://11.22.33.44:5555/pls/SAMPLE'@g" homepage.htm
Where,
String1 ://your server name:port/test/owa
String2... (3 Replies)
Hi,
I have a file with this line, it's always in the first line:
I want to remove these special characters: ´╗┐
file1
´╗┐\\bar\c$\test2\;3.348.118 Bytes;160 ;3
\\bar\c$\test\;35 Bytes;2 ;1
I want the same file to be only
\\bar\c$\test2\;3.348.118 Bytes;160 ;3
\\bar\c$\test\;35... (4 Replies)
I have the foolowing data file:
File1
<p name="A">5004</p>
<p name="B">5004</p>
<p name="C">5004</p>
<p name="A">15004</p>
<p name="B">15004</p>
<p name="C">15004</p>
In a while loop using sed (100 of line need to be replace), I need the output to File3:... (2 Replies)
Hi,
I have a "|" delimited file that is exported from a database.
There is one column in the file which has description/comments entered by some application user. It has "Control-M" character and "New Line" character in between the text.
Hence, when i export the data, this record with the new... (4 Replies)
Discussion started by: tarun.trehan
4 Replies
LEARN ABOUT OSF1
uniq
uniq(1) General Commands Manual uniq(1)NAME
uniq - Removes or lists repeated lines in a file
SYNOPSIS
Current Syntax
uniq [-cdu] [-f fields] [-s chars] [input-file [output-file]]
Obsolescent Syntax
uniq [-cdu] [-fields] [+chars] [input-file [output-file]]
The uniq command reads from the specified input_file, compares adjacent lines, removes the second and succeeding occurrences of a line, and
writes to standard output.
STANDARDS
Interfaces documented on this reference page conform to industry standards as follows:
uniq: XCU5.0
Refer to the standards(5) reference page for more information about industry standards and associated tags.
OPTIONS
Precedes each output line with a count of the number of times each line appears in the file. This option supersedes the -d and -u options.
Displays repeated lines only. Ignores the first fields fields on each input line when doing comparisons, where fields is a positive deci-
mal integer. A field is the maximal string matched by the basic regular expression:
[[:blank:]]*[^[:blank:]]*
If the fields argument specifies more fields than appear on an input line, a null string is used for comparisons. Ignores the spec-
ified number of characters when doing comparisons. The chars argument is a positive decimal integer.
If specified with the -f option, the first chars characters after the first fields fields are ignored. If the chars argument speci-
fies more characters than remain on an input line, uniq uses a null string for comparison. Displays unique lines only. Equivalent
to -f fields. (Obsolescent) Equivalent to -s chars. (Obsolescent)
OPERANDS
A pathname for the input file.
If this operand is omitted or specified as -, then standard input is read. A pathname for the output file.
If this operand is omitted, then standard output is written.
DESCRIPTION
The input_file and output_file arguments must be different files. If the input_file operand is not specified, or if it is -, uniq uses
standard input.
Repeated lines must be on consecutive lines to be found. You can arrange them with the sort command before processing.
EXAMPLES
To delete repeated lines in the following file called fruit and save it to a file named newfruit, enter: uniq fruit newfruit
The file fruit contains the following lines:
apples apples bananas cherries cherries peaches pears
The file newfruit contains the following lines:
apples bananas cherries peaches pears
EXIT STATUS
The following exit values are returned: Successful completion. An error occurred.
ENVIRONMENT VARIABLES
The following environment variables affect the execution of uniq: Provides a default value for the internationalization variables that are
unset or null. If LANG is unset or null, the corresponding value from the default locale is used. If any of the internationalization vari-
ables contain an invalid setting, the utility behaves as if none of the variables had been defined. If set to a non-empty string value,
overrides the values of all the other internationalization variables. Determines the locale for the interpretation of sequences of bytes
of text data as characters (for example, single-byte as opposed to multibyte characters in arguments). Determines the locale for the for-
mat and contents of diagnostic messages written to standard error. Determines the location of message catalogues for the processing of
LC_MESSAGES.
SEE ALSO
Commands: comm(1), sort(1)
Standards: standards(5)uniq(1)