Sponsored Content
Top Forums Shell Programming and Scripting delete lines in file matching a pattern Post 302300617 by jim mcnamara on Tuesday 24th of March 2009 03:06:41 PM
Old 03-24-2009
Code:
awk -F'( |:)'  '$3!=0' file > newfile

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Reading lines in a file matching a pattern

Hi, I need to redirect the lines in a file to a different file if the character starting from 2 to 6 in the line are numerical . Please let me know if anyone have any script to do this. Thanks, Ranjit (4 Replies)
Discussion started by: torenji
4 Replies

2. 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

3. Shell Programming and Scripting

comment/delete a particular pattern starting from second line of the matching pattern

Hi, I have file 1.txt with following entries as shown: 0152364|134444|10.20.30.40|015236433 0233654|122555|10.20.30.50|023365433 ** ** ** In file 2.txt I have the following entries as shown: 0152364|134444|10.20.30.40|015236433 0233654|122555|10.20.30.50|023365433... (4 Replies)
Discussion started by: imas
4 Replies

4. Shell Programming and Scripting

Pattern matching in file and then display 10 lines above every time

hiii, i have to write a shell script like this---- i have a huge log file name abc.log .i have to search for a pattern name "pattern",it may occur 1000 times in the log file,every time it finds the pattern it should display the 10 lines above the pattern. I appericiate your help. (30 Replies)
Discussion started by: namishtiwari
30 Replies

5. Shell Programming and Scripting

Finding lines matching the Pattern and their previous lines in a file

Hi, I am trying to locate the occurences of certain pattern like 'Possible network disconnect' in a text file. I can get the actual lines matching the pttern using: grep -w 'Possible network disconnect' file_name. But I am more interested in getting the timing of these events which are... (7 Replies)
Discussion started by: sagarparadkar
7 Replies

6. Shell Programming and Scripting

how to delete lines from a file which starts with a specific pattern

I need to delete those lines from a file, which starts with 45. How to do it? (3 Replies)
Discussion started by: mady135
3 Replies

7. UNIX for Dummies Questions & Answers

FIND matching pattern of lines in a file

I need to search for two patterns in a file and find number of matching lines. find . -type f | xargs grep "DROP TABLE" | wc -l find . -type f | xargs grep "DROP SYNONYM" | wc -l The above code works. However I am looking at finding a commnd that will simplify as on a singe command... (2 Replies)
Discussion started by: Siva SQL
2 Replies

8. 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

9. Shell Programming and Scripting

Delete all lines from file matching a string

I wish to search and delete all lines in /app/Jenkins/deploy.txt having this filename string /app/Jenkins/file2.mrt as entry: I'm using : colon as delimiter in sed command as I'm dealing with file paths. Below is the command I was expecting to work. sed -i ":/app/Jenkins/file2.mrt:d"... (1 Reply)
Discussion started by: mohtashims
1 Replies

10. UNIX for Beginners Questions & Answers

How do delete certain lines alone which are matching with start and end string values in file?

Hi, In my previous post ( How to print lines from a files with specific start and end patterns and pick only the last lines? ), i have got a help to get the last select statement from a file, now i need to remove/exclude the output from main file: Input File format: SELECT ABCD, DEFGH,... (2 Replies)
Discussion started by: nani2019
2 Replies
mdoc(1) 						      General Commands Manual							   mdoc(1)

NAME
mdoc - Mono documentation management tool SYNOPSIS
mdoc command [options] [args] OVERVIEW
mdoc is an assembly-based documentation management system. mdoc permits creating and updating documentation stubs based on the contents of an assembly. It does not rely on documentation found within the source code. The advantages are: * Code readability. Good documentation is frequently (a) verbose, and (b) filled with examples. (For comparison, compare Microsoft .NET Framework documentation, which is often a page or more of docs for each member, to JavaDoc documentation, which can often be a sentence for each member.) Inserting good documentation into the source code can frequently bloat the source file, as the documentation can be longer than the actual method that is being documented. * Localization. In-source documentation formats (such as csc /doc) have no support for multiple human languages. If you need to sup- port more than one human language for documentation purposes, mdoc is useful as it permits each language's output to reside in its own directory, and mdoc can add types/members for each separate documentation directory. * Administration. It's not unusual to have separate documentation and development teams. It's also possible that the documentation team will have minimal experience with the programming language being used. In such circumstances, inline documentation is not desirable as the documentation team could inadvertantly insert an error into the source code while updating the documentation. Alternatively, you may not want the documentation team to have access to the source code for security reasons. mdoc allows the doc- umentation to be kept completely separate and distinct from the source code used to create the assembly. Documentation can be generated using the mdoc update command: mdoc update -o docs/en ProjectName.dll Once the documentation stubs have been generated (and hopefully later filled in with actual documentation), there are three ways to view the documentation: * To generate a simple directory of HTML pages (one HTML file per type), use mdoc export-html: mdoc export-html -o /srv/www/htdocs/ProjectName docs/en * To use an ASP.NET webapp to display the sources, see: http://anonsvn.mono-project.com/source/trunk/monodoc/engine/web/. From a monodoc source checkout, you can do this: cd engine make web This will use xsp(1) to serve the ASP.NET webapp; Visit http://localhost:8080/ to view the documentation. * To use the monodoc(1) documentation browser, you must first assemble the documentation: mdoc assemble -o ProjectName docs/en The above command creates the files ProjectName.tree and ProjectName.zip. An additional ProjectName.sources file must be provided which describes where in the help system the documentation should be hooked up; it is a very simple XML file, like this: <?xml version="1.0"?> <monodoc> <source provider="ecma" basefile="ProjectName" path="various" /> </monodoc> The above configuration file describes that the documentation is in ECMA format, that the base file name is ProjectName and that it should be hooked up in the "various" part of the documentation tree. If you want to look at the various nodes defined in the docu- mentation, you can look at the monodoc.xml file which is typically installed in /usr/lib/monodoc/monodoc.xml. Once you have all of the required files (.zip, .tree and .sources) you can install them into the system with the following command: cp ProjectName.tree ProjectName.zip ProjectName.source `pkg-config monodoc --variable sourcesdir` The above will copy the files into the directory that Monodoc has registered; you might need root permissions to do this. The actual directory is returned by the pkg-config invocation. MDOC COMMANDS
mdoc assemble Compiles documentation for use within the monodoc(1) browser. See the mdoc-assemble(1) man page for details. mdoc export-html Exports documentation into a directory structure of HTML files. See the mdoc-export-html(1) man page for details. mdoc export-msxdoc Exports documentation into the single-file Microsoft XML Documentation format. See the mdoc-export-msxdoc(1) man page for details. mdoc help View internal help for a given command. mdoc help assemble is equivalent to: mdoc assemble --help Multiple sub-commands may be listed at once: mdoc help assemble export-html update validate mdoc update Updates documentation, adding and removing members based upon a reference assembly. See the mdoc-update(1) man page for details. mdoc validate Validates the documentation against the Mono documentation schema. See the mdoc-validate(1) man page for details. SEE ALSO
mdoc(5), mdoc-assemble(1), mdoc-export-html(1), mdoc-update(1), mdoc-validate(1) MAILING LISTS
Visit http://lists.ximian.com/mailman/listinfo/mono-docs-list for details. WEB SITE
Visit http://www.mono-project.com/mdoc for details mdoc(1)
All times are GMT -4. The time now is 03:58 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy