Sponsored Content
Top Forums UNIX for Beginners Questions & Answers TCL script to insert some text on a file Post 303040465 by Neo on Wednesday 30th of October 2019 01:01:01 AM
Old 10-30-2019
Great!

Please show your code you have written and any error messages you received.
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to insert some constant text at beginig of each line within a text file.

Dear Folks :), I am new to UNIX scripting and I do not know how can I insert some text in the first column of a UNIX text file at command promtp. I can do this in vi editor by using this command :g/^/s//BBB_ e,g I have a file named as Test.dat and it containins below text: michal... (4 Replies)
Discussion started by: Muhammad Afzal
4 Replies

2. Shell Programming and Scripting

Need to insert new text and change existing text in a file using SED

Hi all, I need to insert new text and change existing text in a file. For that I used the below line in the command line and got the expected output. sed '$a\ hi... ' shell > shell1 But I face problem when using the same in script. It is throwing the error as, sed: command garbled:... (4 Replies)
Discussion started by: iamgeethuj
4 Replies

3. Shell Programming and Scripting

awk script to insert text in file

I'm in a time crunch here and I don't know how to write scripts. I have a file of data that looks like the following: 1 7.652073E+00 0.000000E+00 7.146691E+02 1.704154E+01 2 7.652068E+00 6.031387E+00 7.146636E+02 2.499305E+01 3 7.645906E+00 1.509455E+01 7.144158E+02 1.822061E+02 4... (7 Replies)
Discussion started by: pk218703
7 Replies

4. Shell Programming and Scripting

Insert Text On file

Hi All, Can someone pls help me to insert some text on a file. my file contains something like below.. AKBULBU, BALUMIL, BATCH,BATCH BOARROB, BOTAKAT, C57896, CAKIOZE, CHECMER, CICOFRA, CISZPAW,2194485 I want output as USER_ID, LOGIN_ID (6 Replies)
Discussion started by: harshakusam
6 Replies

5. Shell Programming and Scripting

Script to insert text from one file to other file

Hello Team, I need help in preparing script which will insert text from one file to other file. I have requirement to prepare script which will insert data from one file to another file. I have tried using sed and awk command but it is not useful to me as it does not append data in the... (12 Replies)
Discussion started by: coolguyamy
12 Replies

6. Programming

Parsing a text file in Tcl

Hi all, I need to parse through a text file searching for a specific string, then after I find this string read in remaining data off the line to a variable. I've tried various things and can't seem to get any to work. Any help would be much appreciated. (2 Replies)
Discussion started by: caboose57
2 Replies

7. Shell Programming and Scripting

Shell Script to insert text after Tag

Hello, I'm doing an Shell Script to insert a text on XML file, i tried sed, awk, perl... i'm doing something wrong, please help me :) well, the script is a bit large, i get some infos on script before 'run' this part to insert the text on XML... domobile() { let i++ echo ... (1 Reply)
Discussion started by: tassomanoel
1 Replies

8. UNIX for Dummies Questions & Answers

Insert text into a file using shell script

Hi, I need to insert "Hello World" text into a file called hai.txt using shell scripting. Kindly help me. For eg: If I open the file hai.txt by giving linux command cat hai.txt, the content of the file should have the text Hello World in it. Thanks (5 Replies)
Discussion started by: karthick nath
5 Replies

9. Shell Programming and Scripting

How to insert text within a file?

Hi, I am trying to check for missing dates in a file and would want to insert the missing date into the file. Currently the script is as below #!/bin/ksh dates="dates" cat ${dates} | grep -v "^#" curr_month=`date '+%m` curr_day=`date '+%d` curr_year=`date '+%Y` #curr_month=02... (7 Replies)
Discussion started by: newbie_01
7 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.12.1 2010-03-01 Mail::DKIM::TextWrap(3)
All times are GMT -4. The time now is 06:38 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy