02-13-2013
How to delete the lines from file using script?
Hi
Iam having file like below
HTML Code:
10.238.52.65 pun-ras-bng-mhs-01 server
10.238.52.65 pun-ras-bng-mhs-01 10.10.10.10
10.238.52.65 pun-ras-bng-mhs-01 10.10.20.10
10.238.54.1 enk-ras-bng-cse-01 server
10.238.54.1 enk-ras-bng-cse-01 10.10.30.10
10.238.54.1 enk-ras-bng-cse-01 10.10.10.10
Required output file
HTML Code:
10.238.52.65 pun-ras-bng-mhs-01 10.10.10.10
10.238.52.65 pun-ras-bng-mhs-01 10.10.20.10
10.238.54.1 enk-ras-bng-cse-01 10.10.30.10
10.238.54.1 enk-ras-bng-cse-01 10.10.10.10
I dont need the lines which having word server in output file. can any body help.
tnx in advance.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I am trying to delete all the lines out a file from a unix script. Please help
Platform is Sun (3 Replies)
Discussion started by: alnita
3 Replies
2. Shell Programming and Scripting
Hi,
I am a newbie to shell scripting, and I have a file which quite large which I would like to delete lines at certain places. I want to search for a keyword which is recurring in the file. When matched I would like to delete the line. And when the file was so huge I thought I ought to learn... (3 Replies)
Discussion started by: mr_andrew
3 Replies
3. Shell Programming and Scripting
Input:
a
b
b
c
d
d
I need:
a
c
I know how to get this (the lines that have duplicates) :
b
d
sort file | uniq -d
But i need opossite of this. I have searched the forum and other places as well, but have found solution for everything except this variant of the problem. (3 Replies)
Discussion started by: necroman08
3 Replies
4. Shell Programming and Scripting
Hi All,
I have a file with 3 columns (Bank Name, Account Number and Amount). My requirement, I need to delete lines using Unix Shell script:
1. Which are having Alphanumeric characters in Account Number (eg. Line3).
2. Which are having 0.00 in amount. (eg. Line4)
3. And also I need to... (4 Replies)
Discussion started by: phani333
4 Replies
5. UNIX for Dummies Questions & Answers
Hiiii
I have a file which contains huge data as
a.dat:
PDE 1990 1 9 18 51 28.90 24.7500 95.2800 118.0 6.1 0.0 BURMA
event name: 010990D
time shift: 7.3000
half duration: 5.0000
latitude: 24.4200
longitude: 94.9500
depth: 129.6000
Mrr: ... (7 Replies)
Discussion started by: reva
7 Replies
6. Shell Programming and Scripting
Hi Experts,
I have a file in the below given format. First two lines are header and Trailer. Rest all are transaction Lines. I have to delete all other lines except first line (Header) and lines which contains 5000 in 1st column and 0 in 5th column.
Can anyone please kindly provide me with... (6 Replies)
Discussion started by: phani333
6 Replies
7. Shell Programming and Scripting
Hi Experts,
I have a file format as mentioned below. I would like to have unix script (HP Unix) which can:
1. Remove first 6 and last 3 lines.
2. Delete the lines where 3rd column having Alpha Numeric Number
3. Delete the lines where 4th column having 0.00
4. Calculate the sum of all the... (16 Replies)
Discussion started by: phani333
16 Replies
8. Shell Programming and Scripting
it will grep for a line and then delete these line. how do i begin to write this script if theres no available one? (3 Replies)
Discussion started by: garfish
3 Replies
9. Shell Programming and Scripting
File
6 dbnawldb010-b office Memphis_Corp_SQL_Diff Memphis-Corp-SQL-Inc-Application-Backup 03/09/11 03:24:04
42 luigi-b IPNRemitDB Memphis_Corp_SQL_Diff Memphis-Corp-SQL-Inc-Application-Backup 03/10/11 00:41:36
6 ebs-sqldev1-b IPNTracking Memphis_Corp_SQL_Diff... (4 Replies)
Discussion started by: ajiwww
4 Replies
10. UNIX for Advanced & Expert Users
Hi All,
I have a very huge file (4GB) which has duplicate lines. I want to delete duplicate lines leaving unique lines. Sort, uniq, awk '!x++' are not working as its running out of buffer space.
I dont know if this works : I want to read each line of the File in a For Loop, and want to... (16 Replies)
Discussion started by: krishnix
16 Replies
LEARN ABOUT DEBIAN
psimage
PSIMAGE(l) PSIMAGE(l)
NAME
psimage - To plot SUN rasterfiles on maps
SYNOPSIS
psimage rasterfile [ -Wxlength[/ylength] | -Edpi ] [ -Cxpos/ypos ] [ -Fpen ] [ -G[f|b]r/g/b ] [ -I ] [ -K ] [ -M ] [ -Nnxrep/nyrep] [ -O ]
[ -P ] [ -U[dx/dy/][label] ] [ -V ] [ -Xx-shift ] [ -Yy-shift ] [ -ccopies ]
DESCRIPTION
psimage reads a 1, 8, 24, or 32-bit Sun rasterfile and plots it on a map. Image can be scaled arbitrarily, and 1-bit images can be(1)
inverted, i.e., black pixels (on) becomes white (off) and vice versa, or(2) colorized, by assigning different foreground and background
colors, and(3) made transparent where one of back- or foreground is painted only. As an option, the user may choose to convert colorimages
to grayscale using TV's YIQ-transformation.' The user may also choose to replicate the image which, when preceeded by appropriate clip
paths, may allow larger custom-designed fill patterns to be implemented (the -Gp mechanism offered in most GMT programs is limited to
rasters smaller than 146 by 146).
rasterfile
This must be a Sun rasterfile. Depth can be 1, 8, 24, or 32-bit. Old-style, Standard, Run-length-encoded, and RGB Sun rasterfiles
are supported. Other raster formats can be converted to Sun format via a variety of public-domain software (e.g., imconv, xv).
-E Sets the dpi of the image in dots pr inch, or use -W.
-W Sets the size of the image. If not given ylength is set to xlength * (ny/nx). Alternatively, use -E.
OPTIONS
No space between the option flag and the associated arguments.
-C Sets position of lower left corner of image [0/0].
-F Draws a rectangular frame around the image with the given pen [no frame].
-Gb Sets background color (replace white pixel) for 1-bit image templates. Use - for transparency (and set -Gf to the desired color).
-Gf Sets foreground color (replace black pixel) for 1-bit image templates. Use - for transparency (and set -Gb to the desired color).
-I Invert image before plotting (1-bit images only). This is what is done when you use -GP in other GMT programs.
-K More PostScript code will be appended later [Default terminates the plot system].
-M Convert color image to monochrome grayshades using the (television) YIQ-transformation.
-N Replicate the image nxrep in x and nyrep in y [Default is 1/1].
-bo Selects binary output. Append s for single precision [Default is double].
-P Selects Portrait plotting mode [GMT Default is Landscape, see gmtdefaults to change this].
-U Draw Unix System time stamp on plot. User may specify where the lower left corner of the stamp should fall on the page relative to
lower left corner of plot. Optionally, append a label, or c (which will plot the command string.). The GMT parameters UNIX_TIME and
UNIX_TIME_POS can affect the appearance; see the gmtdefaults man page for details.
-V Selects verbose mode, which will send progress reports to stderr [Default runs "silently"].
-X -Y Shift origin of plot by (x-shift,y-shift). Prepend a for absolute coordinates; the default (r) will reset plot origin.
-c Specifies the number of plot copies. [Default is 1]
EXAMPLES
To plot the image contained in the 8-bit rasterfile scanned_face.ras, scaling it to 8 by 10 cm, try
psimage scanned_face.ras -W8c/10c > image.ps
To replicate the image template 1_bit.ras over a 5 by 5 inch area, colorize it, and setting each piece to be 1 by 1 cm, try
psimage 1_bit.ras -Gb200/150/100 -Gf100/50/30 -N5i/5i -W1c > image.ps
SEE ALSO
gmt(1gmt)
1 Jan 2004 PSIMAGE(l)