Sponsored Content
Top Forums Shell Programming and Scripting Read column from file and delete rows with some condition.. Post 302740247 by nex_asp on Wednesday 5th of December 2012 11:59:03 PM
Old 12-06-2012
Read column from file and delete rows with some condition..

Hi....

I have a need of script to do delete row whenever condition is true....

Code:
2.16    (3)    [00]    1    3    9999    0    (1)    (0)    [00]
34.42    (4)    [00]    1    3    9999    37    (2)    (3)    [00]
34.38    (4)    [00]    1    3    9999    64    (2)    (3)    [00]
34.4    (4)    [00]    1    3    1    110    (3)    (3)    [00]
34.38    (4)    [00]    1    3    12    165    (3)    (3)    [00]
34.42    (4)    [00]    1    3    13    220    (3)    (3)    [00]
34.4    (4)    [00]    1    3    9999    274    (3)    (3)    [00]
34.38    (4)    [00]    1    3    9999    348    (3)    (3)    [00]

Here 6th column is having some values, whenever there is 9999, that row should be deleted....

and some columns containing values inside brackets both '()' and []',those brackets should be removed,,,and values inside bracket should be as it is..


Here I have attached my input sample file....please go through it..

Thanks in advance..
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

how to delete duplicate rows based on last column

hii i have a huge amt of data stored in a file.Here in this file i need to remove duplicates rows in such a way that the last column has different data & i must check for greatest among last colmn data & print the largest data along with other entries but just one of other duplicate entries is... (16 Replies)
Discussion started by: reva
16 Replies

2. Shell Programming and Scripting

awk to select rows based on condition on column

I have got a file like this 003ABC00281020091005000100042.810001 ... (8 Replies)
Discussion started by: Maruti
8 Replies

3. Shell Programming and Scripting

delete rows in a file based on the rows of another file

I need to delete rows based on the number of lines in a different file, I have a piece of code with me working but when I merge with my C application, it doesnt work. sed '1,'\"`wc -l < /tmp/fileyyyy`\"'d' /tmp/fileA > /tmp/filexxxx Can anyone give me an alternate solution for the above (2 Replies)
Discussion started by: Muthuraj K
2 Replies

4. Shell Programming and Scripting

Parsing a CSV file and deleting all rows on condition

Hello list, I am working on a csv file which contains two fields per record which contain IP addresses. What I am trying to do is find records which have identical fields(IP addresses) which occur 4(four) times, and if they do, delete all records with that specific identical field(ip address). ... (4 Replies)
Discussion started by: landossa
4 Replies

5. Shell Programming and Scripting

Selecting rows from a pipe delimited file based on condition

HI all, I have a simple challenge for you.. I have the following pipe delimited file 2345|98|1809||x|969|0 2345|98|0809||y|0|537 2345|97|9809||x|544|0 2345|97|0909||y|0|651 9685|98|7809||x|321|0 9685|98|7909||y|0|357 9685|98|7809||x|687|0 9685|98|0809||y|0|234 2315|98|0809||x|564|0 ... (2 Replies)
Discussion started by: nithins007
2 Replies

6. UNIX for Dummies Questions & Answers

Delete rows with unique value for specific column

Hi all I have a file which looks like this 1234|1|Jon|some text|some text 1234|2|Jon|some text|some text 3453|5|Jon|some text|some text 6533|2|Kate|some text|some text 4567|3|Chris|some text|some text 4567|4|Maggie|some text|some text 8764|6|Maggie|some text|some text My third column is my... (9 Replies)
Discussion started by: A-V
9 Replies

7. Shell Programming and Scripting

Capture rows for a column in file from delete sql -Oracle

Hi, This may not be the right forum but i am hoping someone knows an answer to this. I have to capture rows for a column that was deleted. How can i do that without having to write a select query? delete from myschema.mytable where currentdatetimestamp > columnDate this should delete 5... (4 Replies)
Discussion started by: jakSun8
4 Replies

8. UNIX for Dummies Questions & Answers

merging rows into new file based on rows and first column

I have 2 files, file01= 7 columns, row unknown (but few) file02= 7 columns, row unknown (but many) now I want to create an output with the first field that is shared in both of them and then subtract the results from the rest of the fields and print there e.g. file 01 James|0|50|25|10|50|30... (1 Reply)
Discussion started by: A-V
1 Replies

9. Shell Programming and Scripting

Delete if condition met in a column

i have a table like this: id, senderNumber, blacklist ----------------------------- 1 0835636326 Y 2 0373562343 Y 3 0273646833 Y and I want to delete automatically if a new inserted row on another table consist anything on senderNumber column above using a BASH Script I... (9 Replies)
Discussion started by: jazzyzha
9 Replies

10. Shell Programming and Scripting

Read 4th column and print those many rows

Hi, My input file chr1 3217769 3217789 2952725-5 255 + chr1 3260455 3260475 2434087-6 255 - My desired output chr1 3217769 3217789 2952725-1 255 + chr1 3217769 3217789 2952725-2 255 + chr1 3217769 3217789 2952725-3 255 + chr1 3217769 3217789 2952725-4 255 +... (7 Replies)
Discussion started by: jacobs.smith
7 Replies
scvxinstall(1M) 					  System Administration Commands					   scvxinstall(1M)

NAME
scvxinstall - install VERITAS Volume Manager (VxVM) on a cluster node SYNOPSIS
scvxinstall [-d media-image] [-L license...] scvxinstall -H scvxinstall {-i | -e} [-d media-image] [-L license...] scvxinstall -s DESCRIPTION
Note - Beginning with the Sun Cluster 3.2 release, Sun Cluster software includes an object-oriented command set. Although Sun Cluster software still supports the original command set, Sun Cluster procedural documentation uses only the object-oriented command set. For more infor- mation about the object-oriented command set, see the Intro(1CL) man page. The scvxinstall utility provides automatic VxVM installation and optional root-disk encapsulation for Sun Cluster nodes. The first form of the scvxinstall utility in the SYNOPSIS section of this man page runs in interactive mode. All other forms of the utility run in non-interactive mode. o In interactive mode, scvxinstall prompts the user for the mode of operation ("install only" or "install and encapsulate") and for any needed CD-ROM and licensing information. o In non-interactive mode, scvxinstall does not prompt the user for information. If any needed information is not supplied on the utility line, scvxinstall terminates with an error return code. The cluster must meet the following requirements before you run the scvxinstall utility: o All nodes in the cluster configuration must be current cluster members. o Each root disk that you will encapsulate must have at least two free (unassigned) partitions. o All nodes must be added to the node authentication list. o As of VxVM 4.1, you must install VxVM software and licenses before you run the scvxinstall utility. The "install-only" mode of the scvxinstall utility performs the following tasks: 1. Verifies that the node you are installing is booted in cluster mode and is running as root, and verify that all other cluster nodes are running in cluster mode. 2. For VxVM 4.0 or earlier, adds the VxVM software, licensing, and man-page packages, but not the GUI packages. 3. Negotiates a cluster-wide value for the vxio major number by modifying the /etc/name_to_major file. This ensures that the vxio number is the same on all cluster nodes. 4. For VxVM 4.0 or earlier, installs the VxVM license key. 5. Instructs the user to reboot the node to resume operation with the new vxio major numbers in effect. The "install-and-encapsulate" mode of the scvxinstall utility performs the same tasks as the "install-only" mode except Step 5, then per- forms the following additional tasks: 1. Runs several VxVM commands to prepare for root-disk encapsulation. 2. Modifies the global-devices entry in the /etc/vfstab file specified for the /global/.devices/node@n file system, where n is the node ID number. The scvxinstall utility replaces the existing device path /dev/did/{r}dsk with /dev/{r}dsk. This change ensures that VxVM recognizes that the global-devices file system resides on the root disk. 3. Twice reboots each node that is running scvxinstall, once to allow VxVM to complete the encapsulation process and once more to resume normal operation. The scvxinstall utility includes a synchronization mechanism to ensure that it reboots only one node at a time, to prevent loss of quorum. 4. Unmounts the global-devices file system. The file system is automatically remounted after the encapsulation process is complete. 5. Recreates the special files for the root-disk volumes with a unique minor number on each node. You can use this command only in the global zone. OPTIONS
The following options are supported: -d media-image Valid only for VxVM 4.0 or earlier. Specifies the path to the VxVM packages. You can use this option only in the global zone. -e Specifies the "install and encapsulate" mode of the scvxinstall utility. You can use this option only in the global zone. This option installs VxVM, if installing VxVM 4.0 or earlier, encapsulates the root disk, and performs postinstallation tasks. If the scvxinstall utility was previously run on the node in "install only" mode, scvxinstall confirms that "install only" mode tasks are com- pleted before it performs the root-disk encapsulation tasks. -H Specifies the "help" mode of the scvxinstall utility. This option displays a brief help message about the scvxinstall utility. You can use this option only in the global zone. -i Specifies the "install only" mode of the scvxinstall utility. You can use this option only in the global zone. This option installs VxVM, if installing VxVM 4.0 or earlier, and performs postinstallation tasks, but does not encapsulate the root disk. -L license Valid only for VxVM 4.0 or earlier. Specifies a license key for the VxVM software. You can specify the -L license option multiple times to supply multiple license keys to the scvxinstall utility. If you have no additional license keys to install, you can specify the word none for the license argument to the -L option. -s Specifies the "show status" mode of the scvxinstall utility. This option displays the status of running or completed scvxinstall pro- cessing on the node. You can use this option only in the global zone. EXAMPLES
Example 1 Running scvxinstall Interactively The following command runs scvxinstall interactively. example# scvxinstall Example 2 Installing the VxVM Packages Without Encapsulating the Root Disk The following command installs the VxVM 4.0 packages but does not encapsulate the root disk. This command also supplies the VxVM license key. This example assumes that the VxVM CD-ROM is in the CD-ROM drive. example# scvxinstall -i -L "9999 9999 9999 9999 9999 999" Example 3 Installing the VxVM Packages Without Encapsulating the Root Disk The following command installs the VxVM 4.0 packages but does not encapsulate the root disk. The command supplies the path to the CD-ROM images of the VxVM packages, which are stored on a server. example# scvxinstall -i -d /net/myserver/VxVM/pkgs Example 4 Installing the VxVM Packages and Encapsulating the Root Disk The following command installs the VxVM 4.0 packages and encapsulates the root disk. The command supplies the VxVM license key. This exam- ple assumes that the VxVM CD-ROM is in the CD-ROM drive. example# scvxinstall -e -L "9999 9999 9999 9999 9999 999" Example 5 Installing the VxVM Packages and Encapsulating the Root Disk The following command installs the VxVM 4.0 packages and encapsulates the root disk. The command supplies the path to the CD-ROM images and supplies the VxVM license key. example# scvxinstall -e -d /net/myserver/VxVM/pkgs -L "9999 9999 9999 9999 9999 999" Example 6 Encapsulating the Root Disk After Installing VxVM 4.1 Software The following command verifies that VxVM 4.1 software and licenses are installed and configured, encapsulates the root disk, and negotiates a cluster-wide value for the vxio major number. example# scvxinstall -e Example 7 Performing Postinstallation Tasks After Installing VxVM 4.1 Software The following command verifies that VxVM 4.1 software and licenses are installed and configured, then negotiates a cluster-wide value for the vxio major number. example# scvxinstall -i EXIT STATUS
The following exit values are returned: 0 Successful completion. non-zero An error has occurred. FILES
/etc/rc2.d/S74scvxinstall.sh (Solaris 9) An rc script used to complete processing following a root-disk-encapsulation reboot /usr/cluster/lib/svc/method/scvxinstall (Solaris 10) An rc script used to complete processing following a root-disk-encapsulation reboot /var/cluster/logs/install/scvxinstall.log.pid Log file created by scvxinstall /var/cluster/scvxinstall/* Location of temporary files used by scvxinstall ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWsczu, SUNWscr | +-----------------------------+-----------------------------+ |Interface Stability |Evolving | +-----------------------------+-----------------------------+ SEE ALSO
Intro(1CL), cldevice(1CL), cldevicegroup(1CL), clsetup(1CL), cluster(1CL), clvxvm(1CL), scinstall(1M) Sun Cluster Software Installation Guide for Solaris OS Sun Cluster 3.2 10 Apr 2006 scvxinstall(1M)
All times are GMT -4. The time now is 02:16 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy