Sponsored Content
Top Forums Shell Programming and Scripting Removing multiple lines from input file, if multiple lines match a pattern. Post 302956234 by RudiC on Monday 28th of September 2015 09:25:13 AM
Old 09-28-2015
A real although abbreviated sample would be utmost helpful.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Concatenating multiple lines to one line if match pattern

Hi all, I've been working on a script which I have hit a road block now. I have written a script using sed to extract the below data and pumped into another file: Severity............: MAJORWARNING Summary: System temperature is out of normal range. Severity............: MAJORWARNING... (13 Replies)
Discussion started by: phixsius
13 Replies

2. Shell Programming and Scripting

removing pattern which is spread in multiple lines

I have several huge files wich contains oracle table creation scripts as follows: I would need to remove the pattern colored in red above. Any sed/awk/pearl code will be of much help. Thanks (2 Replies)
Discussion started by: sabyasm
2 Replies

3. UNIX for Dummies Questions & Answers

removing multiple lines of text in a file

Hi, I'm trying to remove multiple lines of text based off a series of different words and output it to a new file The document contains a ton of data but i want to delete any line that has the following mx1.rr.biz.com or ns2.ri.biz.com i tried using grep -v filename "mx1.rr.biz.com" >... (3 Replies)
Discussion started by: spartan22
3 Replies

4. Shell Programming and Scripting

Perl: Printing Multiple Lines after pattern match

Hello People, Need some assistance/guidance. OUTLINE: Two files (File1 and File2) File1 has some ids such as 009463_3922_1827 897654_8764_5432 File2 has things along the lines of: Query= 009463_3922_1827 length=252 (252 letters) More stufff here ... (5 Replies)
Discussion started by: Deep9000
5 Replies

5. Shell Programming and Scripting

shell script: grep multiple lines after pattern match

I have sql file containing lot of queries on different database table. I have to filter specific table queries. Let say i need all queries of test1,test2,test3 along with four lines above it and sql queries can be multi lines or in single line. Input file contains. set INSERT_ID=1; set... (1 Reply)
Discussion started by: mirfan
1 Replies

6. Shell Programming and Scripting

Awk match multiple columns in multiple lines in single file

Hi, Input 7488 7389 chr1.fa chr1.fa 3546 9887 chr5.fa chr9.fa 7387 7898 chrX.fa chr3.fa 7488 7389 chr21.fa chr3.fa 7488 7389 chr1.fa chr1.fa 3546 9887 chr9.fa chr5.fa 7898 7387 chrX.fa chr3.fa Desired Output 7488 7389 chr1.fa chr1.fa 2 3546 9887 chr5.fa chr9.fa 2... (2 Replies)
Discussion started by: jacobs.smith
2 Replies

7. Shell Programming and Scripting

Extract a pattern from multiple lines in a file

I have a file that has some lines starts with * I want to get these lines, then get the word between "diac" and "lex". ex. file: ;;WORD AlAx *0.942490 diac:Al>ax lex:>ax_1 bw:Al/DET+>ax/NOUN+ gloss:brother pos:noun prc3:0 prc2:0 prc1:0 prc0:Al_det per:na asp:na vox:na mod:na gen:m num:s... (4 Replies)
Discussion started by: Viernes
4 Replies

8. Shell Programming and Scripting

Match Pattern and print pattern and multiple lines into one line

Hello Experts , require help . See below output: File inputs ------------------------------------------ Server Host = mike id rl images allocated last updated density vimages expiration last read <------- STATUS ------->... (4 Replies)
Discussion started by: tigerhills
4 Replies

9. Shell Programming and Scripting

Remove multiple lines that match pattern

Not sure how I can accomplish this. I would like to remove all interfaces that have the commands I would like to see: switchport port-security, spanning-tree portfast. One line is no problem. interface FastEthernet0/8 spanning-tree portfast interface FastEthernet0/9 spanning-tree... (4 Replies)
Discussion started by: mrlayance
4 Replies

10. Shell Programming and Scripting

Removing carriage returns from multiple lines in multiple files of different number of columns

Hello Gurus, I have a multiple pipe separated files which have records going over multiple Lines. End of line separator is \n and records going over multiple lines have <CR> as separator. below is example from one file. 1|ABC DEF|100|10 2|PQ RS T|200|20 3| UVWXYZ|300|30 4| GHIJKL|400|40... (7 Replies)
Discussion started by: dJHa
7 Replies
LNDIR(1)						      General Commands Manual							  LNDIR(1)

NAME
lndir - create a shadow directory of symbolic links to another directory tree SYNOPSIS
lndir [ options ] fromdir [ todir ] DESCRIPTION
The lndir program makes a shadow copy todir of a directory tree fromdir, except that the shadow is not populated with real files but instead with symbolic links pointing at the real files in the fromdir directory tree. This is usually useful for maintaining source code for different machine architectures. You create a shadow directory containing links to the real source, which you will have usually mounted from a remote machine. You can build in the shadow tree, and the object files will be in the shadow directory, while the source files in the shadow directory are just symlinks to the real files. This scheme has the advantage that if you update the source, you need not propagate the change to the other architectures by hand, since all source in all shadow directories are symlinks to the real thing: just cd to the shadow directory and recompile away. The todir argument is optional and defaults to the current directory. The fromdir argument may be relative (e.g., ../src) and is relative to todir (not the current directory). If you add files, simply run lndir again. New files will be silently added. Old files will be checked that they have the correct link. Deleting files is a more painful problem; the symlinks will just point into never-never land. OPTIONS
-silent Normally lndir outputs the name of each subdirectory as it descends into it. The -silent option suppresses these status messages. -silent may be abbreviated to -s. -ignorelinks If a file in fromdir is a symbolic link, lndir will make the same link in todir rather than making a link back to the (symbolic link) entry in fromdir. The -ignorelinks option changes this behavior. The link created in todir will point back to the corre- sponding (symbolic link) file in fromdir. If the link is to a directory, this is almost certainly the wrong thing. The -ignore- links option may be abbreviated to -i. -withsymdirs If a file in fromdir is a symbolic link to a directory and the -withsymdirs option is specified, lndir will shadow the directory tree the symbolic link points to, whether or not the -ignorelinks is also specified. The -withsymdirs option may be abbreviated to -d. -clean lndir will remove dangling symbolic links and empty directories in the shadow tree. The -clean option may be abbreviated to -c. -cleanonly lndir will do the cleaning phase only, not creating the shadow tree. The todir argument may be provided, and defaults to the cur- rent directory when not provided. -withrevinfo lndir will normally not shadow any BitKeeper, RCS, SCCS, CVS, CVS.adm and .svn subdirectories, nor any .cvsignore and .gitignore files. This option causes these directories and files to be treated as any other, rather than ignored. -withrevinfo may be short- ened to -r. -noexceptions By default, lndir does not shadow files or directories whose name is .DS_Store, or ._.DS_Store, or starts with '.#', or ends in '~'. This option, which may be abbreviated to -E, causes such files to also be shadowed. -except This option adds name to an initially empty list of filenames in fromdir that are not to be shadowed. -except may be specified as -e. This option may be repeated as many times as necessary. DIAGNOSTICS
The program displays the name of each subdirectory it enters, followed by a colon. The -silent option suppresses these messages. A warning message is displayed if the symbolic link cannot be created. The usual problem is that a regular file of the same name already exists. If the link already exists but doesn't point to the correct file, the program prints the link name and the location to which it does point. XFree86 Version 4.7.0 LNDIR(1)
All times are GMT -4. The time now is 12:01 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy