Sponsored Content
Full Discussion: sed to update string pattern
Top Forums UNIX for Beginners Questions & Answers sed to update string pattern Post 303023114 by RavinderSingh13 on Wednesday 12th of September 2018 06:27:27 AM
Old 09-12-2018
Quote:
Originally Posted by dashing201
Hi Ravindra
Thanks for quick reply.
Actual "post" is also a dummy keyword.
I have to run while loop for 20,000 such keywords.
Please share more generic solution.
Sorry Mate, we are here are NOT for free coding service. You have to show your efforts(it could be logical or could be coding) which you have put in order to solve your problem. Then You should mention all details in single shot itself rather than asking us questions each time adding some stuff in there.

Thanks,
R. Singh
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

extract a string after a pattern using sed

I have a very large file and each line has a pattern and it is not position specific. I need to extract the string after the pattern ****MI* is the pattern in the red color 12 digit number is the sting value in the green color and it ends with ~ e.g. ... (1 Reply)
Discussion started by: gunaah
1 Replies

2. Shell Programming and Scripting

help - sed - insert space between string of form XxxAxxBcx, without replacing the pattern

If the string is of the pattern XxxXyzAbc... The expected out put from sed has to be Xxx Xyz Abc ... eg: if the string is QcfEfQfs, then the expected output is Qcf Ef Efs. If i try to substitute the pattern with space then the sed will replace the character or pattern with space,... (1 Reply)
Discussion started by: frozensmilz
1 Replies

3. Shell Programming and Scripting

Delete string between 3rd tab and first pattern with SED

Hello, I have this sentence :Pattern1 Pattern2 Pattern3 Pattern4-which-contains-HELLO-string-and-other-stuff-and-second-HELLO-and-third-HELLO I want to delete everything between the 3rd tab (\t) and the FIRST pattern "HELLO" of the line. Result expected is : Pattern1 ... (7 Replies)
Discussion started by: theclem35
7 Replies

4. Shell Programming and Scripting

Grep the word from pattern line and update in subsequent lines till next pattern line reached

Hi, I have got the below requirement. please suggest. I have a file like, Processing Item is: /data/ing/cfg2/abc.txt /data/ing/cfg3/bgc.txt Processing Item is: /data/cmd/for2/ght.txt /data/kernal/config.klgt.txt I want to process the above file to get the output file like, ... (5 Replies)
Discussion started by: rbalaj16
5 Replies

5. Shell Programming and Scripting

sed or awk command to replace a string pattern with another string based on position of this string

here is what i want to achieve... consider a file contains below contents. the file size is large about 60mb cat dump.sql INSERT INTO `table1` (`id`, `action`, `date`, `descrip`, `lastModified`) VALUES (1,'Change','2011-05-05 00:00:00','Account Updated','2012-02-10... (10 Replies)
Discussion started by: vivek d r
10 Replies

6. Shell Programming and Scripting

Search for a pattern in a String file and count the occurance of each pattern

I am trying to search a file for a patterns ERR- in a file and return a count for each of the error reported Input file is a free flowing file without any format example of output ERR-00001=5 .... ERR-01010=10 ..... ERR-99999=10 (4 Replies)
Discussion started by: swayam123
4 Replies

7. Shell Programming and Scripting

Sed: printing lines AFTER pattern matching EXCLUDING the line containing the pattern

'Hi I'm using the following code to extract the lines(and redirect them to a txt file) after the pattern match. But the output is inclusive of the line with pattern match. Which option is to be used to exclude the line containing the pattern? sed -n '/Conn.*User/,$p' > consumers.txt (11 Replies)
Discussion started by: essem
11 Replies

8. Shell Programming and Scripting

PHP - Regex for matching string containing pattern but without pattern itself

The sample file: dept1: user1,user2,user3 dept2: user4,user5,user6 dept3: user7,user8,user9 I want to match by '/^dept2.*/' but don't want to have substring 'dept2:' in output. How to compose such regex? (8 Replies)
Discussion started by: urello
8 Replies

9. Shell Programming and Scripting

sed -- Find pattern -- print remainder -- plus lines up to pattern -- Minus pattern

The intended result should be : PDF converters 'empty line' gpdftext and pdftotext?xml version="1.0"?> xml:space="preserve"><note-content version="0.1" xmlns:/tomboy/link" xmlns:size="http://beatniksoftware.com/tomboy/size">PDF converters gpdftext and pdftotext</note-content>... (9 Replies)
Discussion started by: Klasform
9 Replies

10. Shell Programming and Scripting

[sed] Finding and sticking the pattern to the beginning of successive lines up to the next pattern

I have a file like below. 2018.07.01, Sunday 09:27 some text 123456789 0 21 0.06 0.07 0.00 2018.07.02, Monday 09:31 some text 123456789 1 41 0.26 0.32 0.00 09:39 some text 456789012 1 0.07 0.09 0.09 09:45 some text 932469494 1 55 0.29 0.36 0.00 16:49 some text 123456789 0 48 0.12 0.15 0.00... (9 Replies)
Discussion started by: father_7
9 Replies
MH-MAIL(5)							     [nmh-1.5]								MH-MAIL(5)

NAME
mh-mail - message format for nmh message system SYNOPSIS
any nmh command DESCRIPTION
nmh processes messages in a particular format. It should be noted that although neither Bell nor Berkeley mailers produce message files in the format that nmh prefers, nmh can read message files in that antiquated format. Each user possesses a mail drop box which initially receives all messages processed by post. Inc will read from that drop box and incorpo- rate the new messages found there into the user's own mail folders (typically "+inbox"). The mail drop box consists of one or more mes- sages. Messages are expected to consist of lines of text. Graphics and binary data are not handled. No data compression is accepted. All text is clear ASCII 7-bit data. The general "memo" framework of RFC-822 is used. A message consists of a block of information in a rigid format, followed by general text with no specified format. The rigidly formatted first part of a message is called the header, and the free-format portion is called the body. The header must always exist, but the body is optional. These parts are separated by an empty line, i.e., two consecutive newline characters. Within nmh , the header and body may be separated by a line consisting of dashes: From: Local Mailbox <user@example.com> To: cc: Fcc: +outbox Subject: The header is composed of one or more header items. Each header item can be viewed as a single logical line of ASCII characters. If the text of a header item extends across several real lines, the continuation lines are indicated by leading spaces or tabs. Each header item is called a component and is composed of a keyword or name, along with associated text. The keyword begins at the left margin, may NOT contain spaces or tabs, may not exceed 63 characters (as specified by RFC-822), and is terminated by a colon (`:'). Cer- tain components (as identified by their keywords) must follow rigidly defined formats in their text portions. The text for most formatted components (e.g., "Date:" and "Message-Id:") is produced automatically. The only ones entered by the user are address fields such as "To:", "cc:", etc. Internet addresses are assigned mailbox names and host computer specifications. The rough for- mat is "local@domain", such as "MH@UCI", or "MH@UCI-ICSA.ARPA". Multiple addresses are separated by commas. A missing host/domain is assumed to be the local host/domain. As mentioned above, a blank line (or a line of dashes) signals that all following text up to the end of the file is the body. No format- ting is expected or enforced within the body. Following is a list of header components that are considered meaningful to various nmh programs. Date: Added by post, contains date and time of the message's entry into the mail transport system. From: This header is filled in by default with the system's idea of the user's local mailbox. This can be changed with the Local-Mailbox profile entry. It contains the address of the author or authors (may be more than one if a "Sender:" field is present). For a stan- dard reply (using repl), the reply address is constructed by checking the following headers (in this order): "Mail-Reply-To:", "Reply-To:", "From:", "Sender:". A "From:" header MUST exist when the message is sent to post, otherwise the message will be rejected. Mail-Reply-To: For a standard reply (using repl), the reply address is constructed by checking the following headers (in this order): "Mail- Reply-To:", "Reply-To:", "From:", "Sender:". Mail-Followup-To: When making a "group" reply (using repl -group), any addresses in this field will take precedence, and no other reply address will be added to the draft. If this header is not available, then the return addresses will be constructed from the "Mail-Reply-To:", or "Reply-To:", or "From:", along with adding the addresses from the headers "To:", "cc:", as well as adding your personal address. Reply-To: For a standard reply (using repl), the reply address is constructed by checking the following headers (in this order): "Mail- Reply-To:", "Reply-To:", "From:", "Sender:". Sender: Required by post in the event that the message has multiple addresses on the "From:" line. It is otherwise optional. This line should contain the address of the actual sender. To: Contains addresses of primary recipients. cc: Contains addresses of secondary recipients. Bcc: Still more recipients. However, the "Bcc:" line is not copied onto the message as delivered, so these recipients are not listed. nmh uses an encapsulation method for blind copies, see send(1). Dcc: Still more recipients. However, the "Dcc:" line is not copied onto the messages as delivered. Recipients on the "Dcc:" line receive the same messsage as recipients on the "To:" and "cc:" lines. See send(1) for more details. Fcc: Causes post to copy the message into the specified folder for the sender, if the message was successfully given to the transport sys- tem. Message-ID: A unique message identifier added by post if the -msgid flag is set. Subject: Sender's commentary. It is displayed by scan. In-Reply-To: A commentary line added by repl when replying to a message. Resent-Date: Added when redistributing a message by post. Resent-From: Added when redistributing a message by post. Resent-To: New recipients for a message resent by dist. Resent-cc: Still more recipients. See "cc:" and "Resent-To:". Resent-Bcc: Even more recipients. See "Bcc:" and "Resent-To:". Resent-Fcc: Copy resent message into a folder. See "Fcc:" and "Resent-To:". Resent-Message-Id: A unique identifier glued on by post if the -msgid flag is set. See "Message-Id:" and "Resent-To:". Resent: Annotation for dist under the -annotate option. Forwarded: Annotation for forw under the -annotate option. Replied: Annotation for repl under the -annotate option. FILES
/var/mail/$USER Location of mail drop SEE ALSO
Standard for the Format of ARPA Internet Text Messages (RFC-822) CONTEXT
None MH.6.8 11 June 2012 MH-MAIL(5)
All times are GMT -4. The time now is 11:37 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy