Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Adding one string at the beginning of each line in a file Post 302384711 by sank on Wednesday 6th of January 2010 06:27:13 AM
Old 01-06-2010
sed -i 's/^/Root /g' a.txt

-i option will do inplace modification.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Adding a character in the beginning of every line in a .dat file

How can i add a character(#) in the beginning of every line in a .dat file (2 Replies)
Discussion started by: Cool Coder
2 Replies

2. Shell Programming and Scripting

input a line at the beginning of every file in a directory?

if need to input a word or anything at the beginning of every file in a directory. how do i accomplish this? say the file is named hyperten. how do i make hyperten the first line of every file in a given directory? thanks (6 Replies)
Discussion started by: Terrible
6 Replies

3. UNIX for Dummies Questions & Answers

write new line at the beginning of an existing file

I was trying to find out the easiest way to write new line to the beginning of an exisiting file. I am using KSH. (5 Replies)
Discussion started by: sailussr
5 Replies

4. Shell Programming and Scripting

[string processing]Adding new line in file

I have a report file which somewhere has a lines starting with word ".sub" I have a new variable named $new. What i am trying to do is insert the content of $new just before the occurrence of ".sub" in the report file. How can I do that? (11 Replies)
Discussion started by: animesharma
11 Replies

5. UNIX for Dummies Questions & Answers

rename file by adding a name in beginning

about 200 files with names as 11_0.pdb 11_60.pdb 12_12.pdb 14_180.pdb are there in my library...I need to rename all of them by addinf File in front of them as: File11_0.pdb File11_60.pdb File12_12.pdb File14_180.pdb I checked many threads but it seems i get even more confused..i... (1 Reply)
Discussion started by: kanikasharma
1 Replies

6. Shell Programming and Scripting

Append file name to the beginning of each line

I want to append file names at the beginning of a line for each row file content abc.txt.gz 123|654|987 bcd.txt.gz 876|trf|kjh I want a single output file with below format abc.txt.gz|123|654|987 bcd.txt.gz|876|trf|kjh This one is working but only with unzip files,need to have... (3 Replies)
Discussion started by: rakesh5300
3 Replies

7. Shell Programming and Scripting

Adding a text in the beginning of a line

Hi, I am doing something like below: cat file1>file3and cat file2>>file3 I wanted to check if there is a way to write a custom message(hardcoded message)something like below at the beginning of each line then PIPE delimitiation and then followed by remaining record. cat file1... (7 Replies)
Discussion started by: Saanvi1
7 Replies

8. Shell Programming and Scripting

How to add one line in the beginning of the file?

Hi gurus, I need add one new line in the begining of current file. current file abc cde add xyz output file newline abc cde add xyz (6 Replies)
Discussion started by: ken6503
6 Replies

9. Shell Programming and Scripting

Put a string to the beginning of a file without a linefeed

Hello, I need to put the following string to the beginning of a file - but it should not create a newline at the end of the string. So, the file I have is a compressed one - with gzip. And I would like to add an ASCII-String to the beginning of the file. The string has a length of 69... (5 Replies)
Discussion started by: API
5 Replies

10. Shell Programming and Scripting

Adding test to beginning and end of list in a file

Hi all and apologies for the silly question, but I've searched and I can't get this right. I have a list of email addresses in a file that I need to blacklist (spam). the list is quite long and I would need to script a small routine so that I can get the following for each line in the file: db... (4 Replies)
Discussion started by: bm555
4 Replies
BURST(1)                                                             [nmh-1.5]                                                            BURST(1)

NAME
burst - explode digests into messages SYNOPSIS
burst [+folder] [msgs] [-inplace | -noinplace] [-quiet | -noquiet] [-verbose | -noverbose] [-version] [-help] DESCRIPTION
Burst considers the specified messages in the named folder to be Internet digests, and explodes them in that folder. If -inplace is given, each digest is replaced by the "table of contents" for the digest (the original digest is removed). Burst then renumbers all of the messages following the digest in the folder to make room for each of the messages contained within the digest. These messages are placed immediately after the digest. If -noinplace is given, each digest is preserved, no table of contents is produced, and the messages contained within the digest are placed at the end of the folder. Other messages are not tampered with in any way. The -quiet switch directs burst to be silent about reporting messages that are not in digest format. The -verbose switch directs burst to tell the user the general actions that it is taking to explode the digest. It turns out that burst works equally well on forwarded messages and blind-carbon-copies as on Internet digests, provided that the former two were generated by forw or send. FILES
$HOME/.mh_profile The user profile PROFILE COMPONENTS
Path: To determine the user's nmh directory Current-Folder: To find the default current folder Msg-Protect: To set mode when creating a new message SEE ALSO
inc(1), msh(1), pack(1), Proposed Standard for Message Encapsulation (RFC-934) DEFAULTS
`+folder' defaults to the current folder `msgs' defaults to cur `-noinplace' `-noquiet' `-noverbose' CONTEXT
If a folder is given, it will become the current folder. If -inplace is given, then the first message burst becomes the current message. This leaves the context ready for a show of the table of contents of the digest, and a next to see the first message of the digest. If -noinplace is given, then the first message extracted from the first digest burst becomes the current message. This leaves the context in a similar, but not identical, state to the context achieved when using -inplace. BUGS
The burst program enforces a limit on the number of messages which may be burst from a single message. This number is on the order of 1000 messages. There is usually no limit on the number of messages which may reside in the folder after the bursting. Although burst uses a sophisticated algorithm to determine where one encapsulated message ends and another begins, not all digestifying programs use an encapsulation algorithm. In degenerate cases, this usually results in burst finding an encapsulation boundary prematurely and splitting a single encapsulated message into two or more messages. These erroneous digestifying programs should be fixed. Furthermore, any text which appears after the last encapsulated message is not placed in a separate message by burst. In the case of digestified messages, this text is usually an "End of digest" string. As a result of this possibly un-friendly behavior on the part of burst, note that when the -inplace option is used, this trailing information is lost. In practice, this is not a problem since correspon- dents usually place remarks in text prior to the first encapsulated message, and this information is not lost. MH.6.8 11 June 2012 BURST(1)
All times are GMT -4. The time now is 07:03 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy