Sponsored Content
Top Forums Shell Programming and Scripting print multiple lines using the grep command. Post 302347663 by methyl on Wednesday 26th of August 2009 07:58:36 AM
Old 08-26-2009
What Operating System are you using?
How are you sending the mail?
How are you reading the mail?

If you are reading the mail with Microsoft Office Outlook, look at the following setting in that program:
Tools / Options / Email Options / "Remove extra line breaks in plain text messages".
If that option is set, uncheck the box.
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Print lines after grep

Hi all, I need help in following scenario. I have a file with about 10,000 lines. There are several lines which have word "START" (all upper case) in them. I want to grep line with word "START" and then do the following 1. Print the line number having word "START" 2. Print the next 11 lines. ... (4 Replies)
Discussion started by: jakSun8
4 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 between two lines after grep for a text string

I have several very large file that are extracts from Oracle tables. These files are formatted in XML type syntax with multiple entries like: <ROW> some information more information </ROW> I want to grep for some words, then print all lines between <ROW> AND </ROW>. Can this be done with AWK?... (7 Replies)
Discussion started by: jbruce
7 Replies

4. UNIX for Dummies Questions & Answers

grep command to find multiple strings in multiple lines in a file.

I want to search files (basically .cc files) in /xx folder and subfolders. Those files (*.cc files) must contain #include "header.h" AND x() function. I am writing it another way to make it clear, I wanna list of *.cc files that have 'header.h' & 'x()'. They must have two strings, header.h... (2 Replies)
Discussion started by: ritikaSharma
2 Replies

5. Shell Programming and Scripting

Print lines before and after..not grep -A

Hi I have this in my file 2011-04-18 15:32:11 system-alert-00012: UDP flood! From xxxxxx to yyyyyyyyyy, int ethernet0/2). Occurred 1 times. 2011-04-18 15:32:11 system-alert-00012: UDP flood! From xxxxxx to yyyyyyyyyy, int ethernet0/2). Occurred 1 times. 2011-04-18 15:32:11... (9 Replies)
Discussion started by: zorrox
9 Replies

6. Shell Programming and Scripting

Grep and print next 10 Lines separated by ,

Hi All, I need to grep through a file for a string and print the next ten lines to a file separating the lines with a , and save it as a csv file to open it as a XL file. The 10 lines should be on a sigle row in xl. Any suggesstions please. Note; I dont have a GNU Grep to use -A flag. ... (6 Replies)
Discussion started by: Nani369
6 Replies

7. Shell Programming and Scripting

Print lines between two strings multiple occurencies (with sed, awk, or grep)

Hello, I can extract lines in a file, between two strings but only one time. If there are multiple occurencies, my command show only one block. Example, monfichier.txt contains : debut_sect texte L1 texte L2 texte L3 texte L4 fin_sect donnees inutiles 1 donnees inutiles 2 ... (8 Replies)
Discussion started by: theclem35
8 Replies

8. AIX

Print output of grep command in multuple lines

HI All, I am using grep command to serach a pattern in a list of files and storing the output in a variable. Then i am applying some logic on that variable to get the required output. But Thing is that when the pattern is present mutiple times in a file, i am getting the output of grep in a... (3 Replies)
Discussion started by: goutam sahoo
3 Replies

9. Shell Programming and Scripting

Parsing OSX UNIX command results which print in multiple lines

from the CLI on a Mac, if you type networksetup -listallnetworkservices then you get results in a multi-line paragraph that look something like this: networksetup -listallnetworkservices An asterisk (*) denotes that a network service is disabled. Wi-Fi Display Ethernet Bluetooth DUN... (7 Replies)
Discussion started by: hungryd
7 Replies
readmail(1)						      General Commands Manual						       readmail(1)

NAME
readmail - read mail from a mail folder or incoming mailbox SYNOPSIS
folder] [number-list|pattern] DESCRIPTION
The program displays messages from your incoming mailbox or a specified mail folder. Within the mail system (see elm(1) with no operands and optionally the or option, displays the appropriate headers and the body of the cur- rent message. With the number-list operand and no options, displays the corresponding messages and a summary of the headers from your incoming mailbox. With the pattern operand and no options, displays the first message that matches the pattern and a summary of the headers from your incom- ing mailbox. Options supports the following options. Print all messages that match pattern. If no pattern was specified, this option is ignored. Use file folder for the operations instead of the incoming mailbox. Include the entire header of the matched message or messages when displaying their text. The default is to display the and lines only. Exclude all headers. Put form feeds ( between message headers. This is useful when printing sets of messages. Operands supports the following operands. number-list A blank-separated list of the ordinal locations of messages in the mail file (i.e., their "message numbers"), up to 25 at a time. The character means the last message in the mail file. Similarly, represents every message in the file (i.e., The message numbers are sorted into ascending order. Thus, produces the same output as pattern A string that is present in one of the messages. This pattern can be typed in directly (no quotes) if the words are separated by a single space in the actual message. The pattern matching is case sensitive, so and are not equiva- lent. Leading digits (on the first word) are not permitted; however, you can precede them with a space and quote the entire string, if the space occurs in the message, as in . EXAMPLES
If you are using to reply to a message from within the mail system, you can insert the text of the current message with the command: If you define an alias similar to: you can use it with a program such to peruse mail as it arrives, without needing to start a mail system (see newmail(1)). AUTHOR
was developed by HP. FILES
Incoming mailbox Temporary file for SEE ALSO
elm(1), newmail(1), vi(1). readmail(1)
All times are GMT -4. The time now is 05:48 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy