Sponsored Content
Special Forums Windows & DOS: Issues & Discussions Trying to add text to the beginning of each line Post 302664935 by pasc on Sunday 1st of July 2012 11:43:29 AM
Old 07-01-2012
so... without sed it is impossible ?
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Add text to beginning of file

Hi I need to add text to the beginning of a file in the same way that cat will put file contents at the end of a file. I want to do this with many files eg cat newtext >> /usr/home/*/*.bat Any ideas? (2 Replies)
Discussion started by: donkey
2 Replies

2. Shell Programming and Scripting

add a number to the beginning of every line

hey, i would like to add a line number to the beginning like so: red blue green yellow will be: 1=>red 2=>blue 3=>green 4=>yellowplease advise thank u. (5 Replies)
Discussion started by: boaz733
5 Replies

3. Shell Programming and Scripting

trying to add text to beginning and end of each line

Well here goes: I tried to write a batch file that adds a specific fixed text to each line of an already existing text file. for the adding text infront of each line I tried this: for /F "delims=" %%j in (list.txt) do echo.STARTTEXT\%%j >> list.txt for adding text after each line I... (0 Replies)
Discussion started by: pasc
0 Replies

4. UNIX for Dummies Questions & Answers

Add word/value at the beginning of each line in a file

how to add value/word at the beginning of each line in a file ? i have file number.txt and the output is below 1000 1001 1002 1003 1004 i want to add 000 at the beginning of each line, desire output is below 0001000 0001001 0001002 0001003 0001004 and so on please advise how... (5 Replies)
Discussion started by: jason6247
5 Replies

5. UNIX for Dummies Questions & Answers

sed - Add a variable line to the end of a block beginning with a regex

Hi, Need some help with sed. I have a file that has sections : e.g. a=blah b=blah d=blah e=blah There's many sections in the file. (1 Reply)
Discussion started by: andyatit
1 Replies

6. Shell Programming and Scripting

How to add a text at the beginning of a text files in a folder?

how to add a text ( surya) at the beginning of a text files (so many) in folder text file: 111111 555555 666666 result: surya 111111 555555 666666 (3 Replies)
Discussion started by: suryanarayana
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

Add new line at beginning and end of a file

Hi, I have a specific requirement to add text at the beginning and end of a plain text file. I tried to use "sed" with '1i' and '$a' flags but these required two separate "sed" commands separated with "|". I am looking for some command/option to join these two in single command parameter. ... (6 Replies)
Discussion started by: bhupinder08
6 Replies

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

10. Shell Programming and Scripting

Insert text at the beginning of every even number line

i am trying to insert text at the beginning of every even number line with awk i can do it with odd number lines with this command awk 'NR%2{$0="some text "$0}1' filehow can i edit this command thanks (5 Replies)
Discussion started by: bob123
5 Replies
Mail::DKIM::TextWrap(3) 				User Contributed Perl Documentation				   Mail::DKIM::TextWrap(3)

NAME
Mail::DKIM::TextWrap - text wrapping module written for use with DKIM SYNOPSIS (FOR MAIL::DKIM USERS) use Mail::DKIM::TextWrap; Just add the above line to any program that uses Mail::DKIM::Signer and your signatures will automatically be wrapped to 72 characters. SYNOPSIS (FOR OTHER USERS) my $output = ""; my $tw = Mail::DKIM::TextWrap->new( Margin => 10, Output => $output, ); $tw->add("Mary had a little lamb, whose fleece was white as snow. "); $tw->finish; print $output; DESCRIPTION
This is a general-purpose text-wrapping module that I wrote because I had some specific needs with Mail::DKIM that none of the contemporary text-wrapping modules offered. Specifically, it offers the ability to change wrapping options in the middle of a paragraph. For instance, with a DKIM signature: DKIM-Signature: a=rsa; c=simple; h=first:second:third:fourth; b=Xr2mo2wmb1LZBwmEJElIPezal7wQQkRQ8WZtxpofkNmXTjXf8y2f0 the line-breaks can be inserted next to any of the colons of the h= tag, or any character of the b= tag. The way I implemented this was to serialize the signature one element at a time, changing the text-wrapping options at the start and end of each tag. TEXT WRAPPING OPTIONS
Text wrapping options can be specified when calling new(), or by simply changing the property as needed. For example, to change the number of characters allowed per line: $tw->{Margin} = 20; Break a regular expression matching characters where a line break can be inserted. Line breaks are inserted AFTER a matching substring. The default is "/s/". BreakBefore a regular expression matching characters where a line break can be inserted. Line breaks are inserted BEFORE a matching substring. Usually, you want to use Break, rather than BreakBefore. The default is "undef". Margin specifies how many characters to allow per line. The default is 72. If no place to line-break is found on a line, the line will extend beyond this margin. Separator the text to insert when a linebreak is needed. The default is " ". If you want to set a following-line indent (e.g. all lines but the first begin with four spaces), use something like " ". Swallow a regular expression matching characters that can be omitted when a line break occurs. For example, if you insert a line break between two words, then you are replacing a "space" with the line break, so you are omitting the space. On the other hand, if you insert a line break between two parts of a hyphenated word, then you are breaking at the hyphen, but you still want to display the hyphen. The default is "/s/". CONSTRUCTOR
new() - create a new text-wrapping object my $tw = Mail::DKIM::TextWrap->new( Output => $output, %wrapping_options, ); The text-wrapping object encapsulates the current options and the current state of the text stream. In addition to specifying text wrapping options as described in the section above, the following options are recognized: Output a scalar reference, or a glob reference, to specify where the "wrapped" text gets output to. If not specified, the default of STDOUT is used. METHODS
add() - process some text that can be wrapped $tw->add("Mary had a little lamb. "); You can add() all the text at once, or add() the text in parts by calling add() multiple times. finish() - call when no more text is to be added $tw->finish; Call this when finished adding text, so that any remaining text in TextWrap's buffers will be output. flush() - output the current partial word, if any $tw->flush; Call this whenever changing TextWrap's parameters in the middle of a string of words. It explicitly allows a line-break at the current position in the string, regardless of whether it matches the current break pattern. perl v5.18.2 2012-11-28 Mail::DKIM::TextWrap(3)
All times are GMT -4. The time now is 09:05 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy