Hi,
I want to write a sed script which from
batiato:
batiato/giubbe:
pip_b.2.txt
pip_b.3.txt
pip_b.3mmm.txt
bennato:
bennato/peterpan:
123.txt
consoli:
pip_a.12.txt
daniele: (2 Replies)
I am trying to delete key word starting with x in a unix text file.
example, I am trying to delete the words like xaa,xabxbb,xbd and so on....
my input file is some thing like this
xaaa w 1234 5678
rwsd ravi xw123
xbc3 ohrd
want to delete words xaaa,xw123 and xbc3 from the above... (10 Replies)
I have my input sometyhing like this
aaa
bbbbbb cccccc
ddddd eeeee
1234 ravi kumar
aaaaaa vvvvvvv
5678 ravi kumar
rrrrrrr mmmmmmm
I want the output as follows.
aaa
bbbbbb cccccc
ddddd eeeee
1234 ravi kumar
aaaaaa vvvvvvv
5678 ravi kumar (2 Replies)
I have my data something like this. I want to delete all the lines before the frist instance of the key word 'ravi kumar'
aaa
bbbbbb cccccc
ddddd eeeee
1234 ravi kumar
aaaaaa vvvvvvv
5678 ravi kumar
rrrrrrr mmmmmmm
I want the output as follows.
1234 ravi kumar
aaaaaa... (8 Replies)
I have my data something like this
I need to search for the keyword yyyy in the susequent lines and if it is present, delete the second line with keyword.
In other words, if a keywords is found in two subsequent lines delete the second line.
input data:
aaaa bbbbb cccc dddd
xxxx... (4 Replies)
Hi all,
I am trying to remove the words which has XYZ as a prt of that.
My input file is something like this :
PHNDAZLF-UPS-XYZ' aaaaaaa bbbbb
ADFRTEJKS-XYZ cccccccc ddddddd rrrrrr
SGETHEHDJ-ABC-RXY' hhhhh ttttt' kkkk
FHJSKSJDKD-XXX-YYY
Output expected is :
aaaaaaa... (7 Replies)
Please let me know wat would be sed command to delete any partcular line from a file and also moving lines below it to up.
ie wen line #9 is deleted data in line #10 should move to #9 and so on. (2 Replies)
I'm new to using sed and grep commands, but have found them extremely useful. However I am having a hard time figuring this one out:
Delete every line containing the word CEN and the next line as well.
ie. test.txt
blue
324 CEN
green
red
blue
324 CEN
green
red
blue
to produce:... (2 Replies)
here is what i want to achieve.. i have a file with below contents
cat fileName
blah blah blah
.
.DROP this
REJECT that
.
--sport 7800 -j REJECT --reject-with icmp-port-unreachable
--dport 7800 -j REJECT --reject-with icmp-port-unreachable
.
.
.
more blah blah blah
--dport 3306... (14 Replies)
Hi
I want to implement something like this:
if( keyword1 exists)
then
check if(keyword2 exists in the same line)
then replace keyword 2 with New_Keyword
else
Add New_Keyword at the end of line
end if
eg:
Check for Keyword JUNGLE and add/replace... (7 Replies)
Discussion started by: dashing201
7 Replies
LEARN ABOUT ULTRIX
ptx
ptx(1) General Commands Manual ptx(1)Name
ptx - create permuted index
Syntax
ptx [option...] [input[output]]
Description
The command generates a permuted index to file input on file output (standard input and output default). It has three phases: the first
does the permutation, generating one line for each keyword in an input line. The keyword is rotated to the front. The permuted file is
then sorted. Finally, the sorted lines are rotated so the keyword comes at the middle of the page. The command produces output in the
form:
.xx "tail" "before keyword" "keyword and after" "head"
where .xx may be an or macro for user-defined formatting. The before keyword and keyword and after fields incorporate as much of the line
as fits around the keyword when it is printed at the middle of the page. The and commands, at least one of which is an empty string "",
are wrapped-around pieces small enough to fit in the unused space at the opposite end of the line. When original text must be discarded,
`/' marks the spot.
Options
The following options can be applied:
-b break Use the characters in the break file as separators. In any case, tab, new line, and space characters are always used
as break characters.
-f Folds upper and lower case letters for sorting.
-g n Uses specified number as interfield gap. The default gap is 3 characters.
-i ignore Do not use as keywords any words given in the ignore file. If the -i and -o options are missing, use /usr/lib/eign as
the ignore file.
-o only Use words listed only in the only file.
-r Uses leading nonblanks as reference identifiers. Attach that identifier as a 5th field on each output line.
-t Prepares the output for the phototypesetter. The default line length is 100 characters.
-w n Use the next argument, n, as the width of the output line. The default line length is 72 characters.
Restrictions
Line length counts do not account for overstriking or proportional spacing.
Files
/usr/bin/sort
/usr/lib/eign
ptx(1)