Sponsored Content
Full Discussion: delete records from a file
Top Forums Shell Programming and Scripting delete records from a file Post 302135512 by dsravan on Monday 10th of September 2007 08:34:16 AM
Old 09-10-2007
Thanks Klashxx

Can you explain what this means.

awk -F'|' '$2 !~ /^abc$/' input_file.txt > output_file.txt

does !~ means equal to? i thought its not equal to?
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Delete Duplicate records from a tilde delimited file

Hi All, I want to delete duplicate records from a tilde delimited file. Criteria is considering the first 2 fields, the combination of which has to be unique, below is a sample of records in the input file 1620000010338~2446694087~0~20061130220000~A00BCC1CT... (5 Replies)
Discussion started by: irshadm
5 Replies

2. UNIX for Dummies Questions & Answers

Use records from one file to delete records in another file

file_in_1: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 file_in_2: 9 10 11 12 21 22 23 24 1 2 3 4 17 18 19 20 file_out: (5 Replies)
Discussion started by: kenneth.mcbride
5 Replies

3. UNIX for Dummies Questions & Answers

How can you delete records in a file matching a pattern?

I am curious if the following can be done in a file in unix. Let's say I have a flat file with the following data AAA,12,2,,,, BBB,3,1,,,, CCC,,,,, DDD,2,,,,, SQQ,,,,, ASJ,,3,5 I only want to capture the data with values into a new file. If the data contains the pattern ,,,,, as in... (2 Replies)
Discussion started by: mode09
2 Replies

4. UNIX and Linux Applications

How to delete files with no records?

Hi, I have a file whose size is not zero but it has no records and another which has records. I want to delete all the files that have no records in it (even if size > 0). How do I do it? I have tried the below option #!/bin/ksh temp1 = $(wc -l < INVX102C.sf) if ; then echo "Data... (3 Replies)
Discussion started by: sangharsh
3 Replies

5. UNIX for Dummies Questions & Answers

Grep specific records from a file of records that are separated by an empty line

Hi everyone. I am a newbie to Linux stuff. I have this kind of problem which couldn't solve alone. I have a text file with records separated by empty lines like this: ID: 20 Name: X Age: 19 ID: 21 Name: Z ID: 22 Email: xxx@yahoo.com Name: Y Age: 19 I want to grep records that... (4 Replies)
Discussion started by: Atrisa
4 Replies

6. Shell Programming and Scripting

Need unix commands to delete records from one file if the same record present in another file...

Need unix commands to delete records from one file if the same record present in another file... just like join ... if the record present in both files.. delete from first file or delete the particular record and write the unmatched records to new file.. tried with grep and while... (6 Replies)
Discussion started by: msathees
6 Replies

7. UNIX for Dummies Questions & Answers

Delete records from a big file based on some condition

Hi, To load a big file in a table,I have a make sure that all rows in the file has same number of the columns . So in my file if I am getting any rows which have columns not equal to 6 , I need to delete it . Delimiter is space and columns are optionally enclosed by "". This can be ... (1 Reply)
Discussion started by: hemantraijain
1 Replies

8. Shell Programming and Scripting

Delete records within a file upon a condition

Hi Friends, I have the following file, cat input chr1 1000 2000 chr1 600 699 chr1 701 1000 chr1 600 1710 chr2 900 1800 Now, I would like to see the difference of Record1.Col2 - Record2.Col2 Record1.Col2 - Record2.Col3 Record1.Col3 - Record2.Col2 Record1.Col3 - Record2.Col3 ... (1 Reply)
Discussion started by: jacobs.smith
1 Replies

9. UNIX for Dummies Questions & Answers

Delete records based on a text file from a text file

Hi Folks, I am a novice and need to build a script in bash. I have 2 text files data.txt file is big file, column 2 is the we need to search and delete in the output. The filter file contains the rows to be deleted. Data.txt state city zone Alabama Huntsville 4 California SanDiego 3... (3 Replies)
Discussion started by: tech_frk
3 Replies

10. Shell Programming and Scripting

Delete the records in file based on lookup file.

Hi I have two files one.txt and two.txt one.txt 123 324 456 235 456 two txt abc one 000 123 abc abc one 000 456 abc abc one 000 122 abc abc one 000 111 abc My question here is, the records which are present in one.txt has to deleted in second file two.txt my output result... (2 Replies)
Discussion started by: Ganesh L
2 Replies
mosy(8) 						      System Manager's Manual							   mosy(8)

NAME
mosy - The managed object syntax compiler. SYNOPSIS
/usr/sbin/mosy [-d] [-i] [-o output_file] [-s] [-1] input_file OPTIONS
Specifies no duplicate entries in the output file. By default, if duplicate entries exist in the input file, they will also exist in the output file. Specifies that errors are ignored. This option causes the mosy program to create an output file even if it encounters errors. The default behavior is that the mosy program generates no output file when errors are encountered. Specifies the file to create for mosy output. If not specified, the output file is derived from the input file name by replacing the suffix with or appending input_file is not specified (or is specified as a hyphen (-) for standard input), output goes to standard output. You can also use a hyphen (-) to specify the output file name, which means output to standard out. Indicates silent mode which turns off the default behavior of printing out objects names, type names, and identifiers. Specifies that the mosy program will perform only the first validation pass when compiling. The mosy program prints the input_file contents as it parses, which is useful when debugging syntax errors. OPERANDS
Specifies a text file in MIB format describing a set of managed objects. If you do not specify an input_file or specify a hyphen (-), the program accepts input from standard input. DESCRIPTION
The mosy program reads a description of an SNMP-managed objects module (extracted from a MIB) and produces a simple ASCII file containing equivalent definitions. The output file is used by various management applications. In particular, mosy output files are used as input to the snmpi program when developing extensible SNMP subagents for Tru64 UNIX. The input_file is typically obtained by cleaning up an RFC file that defines a MIB. (You can use the /usr/examples/esnmp/mib_converter.sh script to perform this task.) For a complete description of using mosy and developing subagents refer to the Network Programmer's Guide. EXAMPLES
Compile the file chess.my with the output going to the file chess.defs. # mosy chess Clean up the MIB defined in RFC1514.txt and compile it, placing the output in file fred.objects # /usr/examples/esnmp/mib-converter.sh < rfc1514.txt > rfc1514.my # /usr/sbin/mosy -o fred.objects rfc1514.my You must copy the /usr/examples/esnmp/mib-converter.sh program to another directory and make it executable in order to perform this operation. FILES
SEE ALSO
Commands: snmpd(8), snmpi(8), snmp_request(8) Network Programmer's Guide IDENTIFICATION
Marshall T. Rose, Performance Systems International This work was partially supported by the U.S. Defense Advanced Research Projects Agency and the Rome Air Development Center of the U.S. Air Force Systems Command under contract number F30602-88-C-0016. It has been modified for use in Tru64 UNIX extensible SNMP. mosy(8)
All times are GMT -4. The time now is 06:08 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy