I know that this my be really simple, but I'm having a hard time accomplishing it. I am trying to add a new line of text after finding a particular string of text in a file. Here's what I'm getting:
sed: command garbled: N/search_string/\\new_text/
I was using "N" to add a line after the... (3 Replies)
trying to remove the portion in red:
Data:
mds_ar/bin/uedw92wp.ksh: $AI_SQL/wkly.sql
mds_ar/bin/uedw92wp.ksh: $EDW_TMP/wkly.sql
output to be:
mds_ar/bin/uedw92wp.ksh: wkly.sql
mds_ar/bin/uedw92wp.ksh: wkly.sql
SED i'm trying to use:
sed 's/:+\//: /g' input_file.dat >... (11 Replies)
Im trying to add 5 blank spaces to the end of each line in a file in a sed script. I can figure out who o put the spaces pretty much anywhere else but at the end.
thanks
Karl (7 Replies)
This is my first post, please be nice. I have tried to google and read different tutorials.
The task at hand is:
Input file input.txt (example)
abc123defhij-E-1234jslo
456ujs-W-abXjklp
From this file the task is to grep the -E- and -W- strings that are unique and write a new file... (5 Replies)
what is the sed command to remove the first two characters of every line of a text file?
each line of the text file has the same amount of characters, and they are ALL NUMERIC. there are hundreds of lines though.
for example,
>cat file1.txt
10081551
10081599
10082234
10082259
20081134... (20 Replies)
I've been playing with sed, trying to get it to insert the contents of somefile.txt after line 13 on anotherfile.txt. I tried searching for a line with regex and attempting to insert something on the next line with:
find ./anotherfile.txt -type f -exec sed -i -e '/^dog/cat/' {} \;
but it... (2 Replies)
help
i need to add a "nfsd" in new line after cron
ex:
cron
rpcbind
output:
cron
nfsd
rpcbind
i use
sed -e "/cron/G; s/$/nfsd/" myfile
output:
cron
nfsd
rpcbindnfsd (5 Replies)
hi guys,
im trying to add the following line in my xml file
<dbrollbacksegs <oa_var="s_db_rollback_segs">NOROLLBACK</dbrollbacksegs>
when ever i find the following line
<dbsharedpool oa_var="s_dbsharedpool_size">300000000</dbsharedpool>
I have succedded till adding a new line... (1 Reply)
Hi all,
Is there other way to Add text at start and ending of every line?
here my script:
cat file.txt |awk '{print "<p align=\"justify\">"$0"</p>"}'
but the problem they put including white spaces, I only need those line have a sentence or text not an skip all have empty string or have... (7 Replies)
Discussion started by: lxdorney
7 Replies
LEARN ABOUT HPUX
uniq
uniq(1) General Commands Manual uniq(1)NAME
uniq - report repeated lines in a file
SYNOPSIS
fields] chars] [input_file [output_file]]
DESCRIPTION
reads the input text file input_file, comparing adjacent lines, and copies the result to output_file. If input_file is not specified, the
standard input and standard output are used. If input_file is specified, but output_file is not, results are printed to standard output.
input_file and output_file must not be the same file.
Line-Comparison Options
recognizes the following options when comparing adjacent lines:
Print those lines that are repeated in the original file.
Print copy only of each repeated line in the input file.
Generate an output report in default style
except that each line is preceded by a count of the number of times it occurred. If this option is specified, the and
options are ignored if either or both are also present.
If none of the options or are present, prints the results of the union of the and options, producing a copy of the original input file with
the second and succeeding copies of any repeated lines removed. (Note that repeated lines must be adjacent in order to be found -- see
sort(1)).
Field-Skip Options
Two options are provided for skipping an initial portion of each line when making comparisons:
Ignore the first
fields fields, together with any blanks before each. fields is a positive decimal integer. A field is defined as a
string of non-space, non-tab characters separated by tabs and/or spaces from its neighbors.
Ignore the first
chars characters. chars is a positive decimal integer. Each line in the input is assumed to be terminated with a
new line character for purposes of comparison. Fields are skipped before characters.
EXTERNAL INFLUENCES
Environment Variables
must be equal to the value it had when the input files were sorted.
determines the interpretation of text within files as single- and/or multi-byte characters, and defines a space character when the or
option is used.
determines the language in which messages are displayed.
If or is not specified in the environment or is set to the empty string, the value of is used as a default for each unspecified or empty
variable. If is not specified or is set to the empty string, a default of "C" (see lang(5)) is used instead of If any internationalization
variable contains an invalid setting, behaves as if all internationalization variables are set to "C". See environ(5).
International Code Set Support
Single- and multi-byte character code sets are supported.
RETURN VALUE
Exit values are:
0 Successful completion.
>0 Error condition occurred.
AUTHOR
was developed by OSF and HP.
SEE ALSO comm(1), sort(1).
STANDARDS CONFORMANCE uniq(1)