Sponsored Content
Top Forums Shell Programming and Scripting How to print file without few exactly matching lines? Post 302387385 by ananyob on Friday 15th of January 2010 02:08:30 PM
Old 01-15-2010
Question How to print file without few exactly matching lines?

Hi I have a very long file with 4 columns of numbers for example
1875 1876 12725 12723
13785
13786 4232 4230
13184 13185 2920 2918
5943 5944 8232 8230
17198
17199 9575 9573
5216 5217 16848 16846
4510
4511 11552 11550
How can I print the file using AWK/GREP without the lines '1875 1876 12725 12723' and '5943 5944 8232 8230'? The above example is a short version of what I want to do.....I need to print without some 60 lines from a file having 35000 lines

I know it can be done with line numbers but since the file is long, I want to put in the exact lines and want to print the file without these exact lines? Please help.
Smilie
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

I want to print next 3 lines after pattern matching.

Dear Experts, I have file called file1 in which i am greping a pattern after that i want to next 3 lines when that pattern is matched. Ex:- file1 USA UK India Africa Hello Asia Europe Australia Hello Peter Robert Jo i want to next 3 lines after matching Hello... (12 Replies)
Discussion started by: naree
12 Replies

2. Shell Programming and Scripting

AIX equivalent to GNU grep's -B and -A [print lines after or before matching lines]

Hi folks I am not allowed to install GNU grep on AIX. Here my code excerpt: grep_fatal () { /usr/sfw/bin/gegrep -B4 -A2 "FATAL|QUEUE|SIGHUP" } Howto the same on AIX based machine? from manual GNU grep ‘--after-context=num’ Print num lines of trailing context after... (4 Replies)
Discussion started by: slashdotweenie
4 Replies

3. Shell Programming and Scripting

Print lines matching value(s) in other file using awk

Hi, I have two comma separated files. I would like to see field 1 value of File1 exact match in field 2 of File2. If the value matches, then it should print matched lines from File2. I have achieved the results using cut, paste and egrep -f but I would like to use awk as it is efficient way and... (7 Replies)
Discussion started by: SBC
7 Replies

4. Shell Programming and Scripting

Print matching lines in a file

Hello everyone, I have a little script below: die "Usage infile outfile reGex" if @ARGV != 3; ($regex) = @ARGV; open(F,$ARGV) or die "Can't open"; open(FOUT,"+>$ARGV") or die "Can't open"; while (<F>) { print FOUT if /$regex/.../$regex/; } No matter what I give $regex on the... (2 Replies)
Discussion started by: new bie
2 Replies

5. Shell Programming and Scripting

print lines between 2 matching patterns

Hi Guys, I have file like below, I want to print all lines between test1231233 to its 10 occurrence(till line 41) test1231233 qwe qwe qweq123 test1231233 qwe qwe qweq23 test1231233 qwe qwe qweq123 test1231233 qwe qwe qweq123131 (3 Replies)
Discussion started by: jagnikam
3 Replies

6. Shell Programming and Scripting

Look up between 2 files and print matching lines

Hi, I have 2 large log files in .gz format file 1 contains abcde 12345 23456 . . . . . . . . 09123 (8 Replies)
Discussion started by: aravindj80
8 Replies

7. Shell Programming and Scripting

How to print all the lines after pattern matching?

I have a file that contains... Number -------------------- 1 2 3 4 i want to print all the numbers after the hyphen ... (6 Replies)
Discussion started by: ankitknit
6 Replies

8. Shell Programming and Scripting

Compare file1 for matching line in file2 and print the difference in matching lines

Hello, I have two files file 1 and file 2 each having result of a query on certain database tables and need to compare for Col1 in file1 with Col3 in file2, compare Col2 with Col4 and output the value of Col1 from File1 which is a) not present in Col3 of File2 b) value of Col2 is different from... (2 Replies)
Discussion started by: RasB15
2 Replies

9. Shell Programming and Scripting

Want to print out lines with a matching pattern from file

Hi all, I want to search for strings in file1 that can be found in file2 and print out the whole line when matching pattern is found. I have used the below command, but this is not working for me, because it is writing out only the matching patterns from file2, not the whole line. fgrep -o... (2 Replies)
Discussion started by: MonikaB
2 Replies

10. Shell Programming and Scripting

Print lines after matching two pattern

would like to print everything after matching two patterns AAA and BBB. output : CCC ZZZ sample data : AAA BBB CCC ZZZ (4 Replies)
Discussion started by: jhonnyrip
4 Replies
unexport(1m)															      unexport(1m)

NAME
unexport - Removes binding information, interface identifiers, and object UUIDs from a server entry SYNOPSIS
rpccp unexport entry-name {[-i if-id [-v versions]] | [-o object-uuid]} [-s syntax] OPTIONS
Defines an interface identifier to be unexported (optional). Only one interface can be unexported in a single operation. If specified, binding information for this interface is removed from the entry. The -i option can be qualified by the -v option. The value has the fol- lowing form: interface-uuid,major-version.minor-version The UUID is a hexadecimal string and the version numbers are decimal strings, for example: -i ec1eeb60-5943-11c9-a309-08002b102989,1.1 Leading zeros in version numbers are ignored. Indicates how a specified interface version is used (optional). If it is used without the -i option, the -v option is ignored. The possible combinations of versions for the -v option and their actions are described in the following table. +-----------+-------------------------------------+ |Versions | Action | +-----------+-------------------------------------+ |all | The interface version is ignored. | |exact | Both the major and minor versions | | | must match the specified versions. | |compatible | The major version must match the | | | specified version, and the minor | | | version must be greater than or | | | equal to the specified version. | |major_only | The major version must match the | | | specified version; the minor ver- | | | sion is ignored. | |upto | The major version must be less than | | | or equal to that specified. If the | | | major versions are equal, the minor | | | version must be less than or equal | | | to that specified. | +-----------+-------------------------------------+ +-----------+-------------------------------------+ If the -v option is absent, the command shows compatible version numbers. Defines an object to be unexported (optional). Each unexport command accepts up to 32 -o options. The UUID is a hexadecimal string, for example: -o 3c6b8f60-5945-11c9-a236-08002b102989 Indicates the name syntax of the entry name (optional). The only value for this option is the dce name syntax, which is the default name syntax. Until an alternative name syntax becomes available, specifying the -s option is unnecessary. ARGUMENTS
Indicates the name of the target name service entry. Usually, the target is a server entry. However, objects also can be exported (with- out an interface identifier or binding information) to a group or a profile. For an entry in the local cell, you can omit the cell name and specify only the cell-relative name. DESCRIPTION
The unexport command removes binding information and an interface identifier, object UUIDs, or both from a server entry, or it removes object UUIDs from a group's entry. The command requires the entry name and either the interface identifier or one or more object UUIDs. By default, the unexport operation removes compatible interface versions. Privilege Required You need both read permission and write permission to the CDS object entry (the target name service entry). NOTE
This command is replaced at Revision 1.1 by the dcecp command and may not be provided in future releases of DCE. EXAMPLES
The initial shell commands set up an environment variable Calendar_1_1, which represents the interface identifier of an RPC interface. The control program commands start the control program and remove (unexport) the Calendar Version 1.1 interface from the server entry /.:/LandS/anthro/Cal_host_2 in the local cell, as follows: $ Calendar_1_1=ec1eeb60-5943-11c9-a309-08002b102989,1.1 $ export Calendar_1_1 $ rpccp rpccp> unexport > -i Calendar_1_1 > /.:/LandS/anthro/Cal_host_2 rpccp> RELATED INFORMATION
Commands: export(1m), import(1m), show server(1m) unexport(1m)
All times are GMT -4. The time now is 04:56 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy