Sponsored Content
Top Forums Shell Programming and Scripting NAWK to remove lines that matches a specific pattern Post 302483010 by panyam on Thursday 23rd of December 2010 10:02:13 AM
Old 12-23-2010
A more suitable input file as an input will make more sense.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

How to select lines in unix matches a pattern at a particular position

I have huge file. I want to copy the lines which have first character as 2 or 7, and also which has fist two characters as 90. I need only these records from file. How I can acheive this. Can somebody help me..... (2 Replies)
Discussion started by: cs_banda
2 Replies

2. Shell Programming and Scripting

Displaying lines of a file where the second field matches a pattern

Howdy. I know this is most likely possible using sed or awk or grep, most likely a combination of them together, but how would one go about running a grep like command on a file where you only try to match your pattern to the second field in a line, space delimited? Example: You are... (3 Replies)
Discussion started by: LordJezoX
3 Replies

3. Shell Programming and Scripting

Remove if the above line matches pattern

but keep if does not I have a file: --> my.out foo: bar foo: moo blarg i am on vacation foo: goose foo: lucy foo: moose foo: stucky groover@monkey.org foo: bozo grimace@gonzo.net dear sir - blargo blargo foo: goon foo: sloppy foo: saudi gimme gimme gimme (3 Replies)
Discussion started by: spacegoose
3 Replies

4. Shell Programming and Scripting

Merge lines from one file if pattern matches

I have one comma separated file (a.txt) with two or more records all matching except for the last column. I would like to merge all matching lines into one and consolidate the last column, separated by ":". Does anyone know of a way to do this easily? I've searched the forum but most talked... (6 Replies)
Discussion started by: giannicello
6 Replies

5. Shell Programming and Scripting

Merge lines if pattern matches in ksh

I have a file like this. Pls help me to solve this . (I should look for only Message : 111 and need to print the start time to end time Need to ignore other type of messages. Ex: if first message is 111 and second message is 000 or anything else then ignore the 2nd one and print start time of the... (1 Reply)
Discussion started by: mnjx
1 Replies

6. Shell Programming and Scripting

awk to sum specific field when pattern matches

Trying to sum field #6 when field #2 matches string as follows: Input data: 2010-09-18-20.24.44.206117 UOWEXEC db2bp DB2XYZ hostname 1 2010-09-18-20.24.44.206117 UOWWAIT db2bp DB2XYZ hostname ... (3 Replies)
Discussion started by: ux4me
3 Replies

7. Shell Programming and Scripting

remove contents including the tag if pattern matches

Hi all, Can anyone help me on this. I have several WP sites that are affected by sql injections. But the contents are different as follows western union india belgaum western union india bolegaon western union india barhaj western union india budhana western union india belda western... (6 Replies)
Discussion started by: sanjuabraham
6 Replies

8. Shell Programming and Scripting

Remove entire line from a file if 1st column matches a pattern

I have one requirement to delete all lines from a file if it matches below scenario. File contains three column. Employee Number, Employee Name and Employee ID Scenario is: delete all line if Employee Number (1st column) contains below 1. Non-numeric Employee Number 2. Employee Number that... (3 Replies)
Discussion started by: anshu ranjan
3 Replies

9. Shell Programming and Scripting

awk to remove lines in file if specific field matches

I am trying to remove lines in the target.txt file if $5 before the - in that file matches sorted_list. I have tried grep and awk. Thank you :). grep grep -v -F -f targets.bed sort_list grep -vFf sort_list targets awk awk -F, ' > FILENAME == ARGV {to_remove=1; next} > ! ($5 in... (2 Replies)
Discussion started by: cmccabe
2 Replies

10. UNIX for Beginners Questions & Answers

awk with sed to combine lines and remove specific odd # pattern from line

In the awk piped to sed below I am trying to format file by removing the odd xxxx_digits and whitespace after, then move the even xxxx_digit to the line above it and add a space between them. There may be multiple lines in file but they are in the same format. The Filename_ID line is the last line... (4 Replies)
Discussion started by: cmccabe
4 Replies
GRIND(1)						      WordNettm User Commands							  GRIND(1)

NAME
grind - process WordNet lexicographer files SYNOPSIS
grind [ -v ] [ -s ] [ -Llogfile ] [ -a ] [ -d ] [ -i ] [ -o ] [ -n ] filename [ filename... ] DESCRIPTION
grind() processes WordNet lexicographer files, producing database files suitable for use with the WordNet search and interface code and other applications. The syntactic and structural integrity of the input files is verified. Warnings and errors are reported via stderr and a run-time log is produced on stdout. A database is generated only if there are no errors. Input Files Input files correspond to the syntactic categories implemented in WordNet - noun, verb, adjective and adverb. Each input lexicographer file consists of a list of synonym sets (synsets) for one part of speech. Although the basic synset syntax is the same for all of the parts of speech, some parts of the syntax only apply to a particular part of speech. See wninput(5WN) for a description of the input file format. Each filename specified is of the form: pathname/pos.suffix where pathname is optional and pos is either noun, verb, adj or adv. suffix may be used to separate groups of synsets into different files, for example noun.animal and noun.plant. One or more input files, in any combination of syntactic categories, may be specified. See lexnames(5WN) for a list of the lexicographer files used to build the complete WordNet database. Output Files grind() produces the following output files: +------------+----------------------------------------+ | Filename | Description | +------------+----------------------------------------+ |index.pos | Index file for each syntactic category | |data.pos | Data file for each syntactic category | |index.sense | Sense index | +------------+----------------------------------------+ See wndb(5WN) for a description of the database file formats. Each time grind() is run, any existing database files are overwritten with the database files generated from the specified input files. If no input files from a syntactic category are specified, the corresponding database files are not overwritten. Sense Numbers Senses are generally ordered from most to least frequently used, with the most common sense numbered 1. Frequency of use is determined by the number of times a sense is tagged in the various semantic concordance texts. Senses that are not semantically tagged follow the ordered senses in an arbitrary order. Note that this ordering is only an estimate based on usage in a small corpus. The tagsense_cnt field for each entry in the index.pos files indicates how many of the senses in the list have been tagged. The cntlist file provided with the database lists the number of times each sense is tagged in the semantic concordances. grind() uses the data from cntlist to order the senses of each word. When the index.pos files are generated, the synset_offsets are output in sense number order, with sense 1 first in the list. Senses with the same number of semantic tags are assigned unique but consecutive sense numbers. The WordNet OVERVIEW search displays all senses of the specified word, in all syntactic categories, and indicates which of the senses are represented in the semantically tagged texts. OPTIONS
-v Verify integrity of input without generating database. -s Suppress generation of warning messages. Usually grind is run with this option until all syntactic and structural errors are corrected since the warning messages may make it difficult to spot error messages. -Llogfile Write all messages to logfile instead of stderr. -a Generate statistical report on input files processed. -d Generate distribution of senses by string length report on input files processed. -i Generate sense index file. -o Order senses using cntlist. -n Generate nominalization (derivational morphology) links in database. filename Input file of the form described in Input Files. FILES
pos.* lexicographer files to use to build database cntlist file of combined semantic concordance cntlist files. Used to assign sense numbers in WordNet database SEE ALSO
cntlist(5WN), lexnames(5WN), senseidx(5WN), wndb(5WN), wninput(5WN), uniqbeg(7WN), wngloss(7WN). DIAGNOSTICS
Exit status is normally 0. Exit status is -1 if non-specific error occurs. If syntactic or structural errors exist, exit status is number of errors detected. usage: grind [-v] [-s] [-Llogfile] [-a ] [-d] [-i] [-o] [-n] filename [filename...] Invalid options were specified on the command line. No input files processed. None of the filenames specified were of the appropriate form. n syntactic errors found. Syntax errors were found while parsing the input files. n structural errors found. Pointer errors were found that could not be automatically corrected. BUGS
Please report bugs to wordnet@princeton.edu. WordNet 3.0 Dec 2006 GRIND(1)
All times are GMT -4. The time now is 12:58 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy