Sponsored Content
Top Forums Shell Programming and Scripting sed random \n for "n" range of character occurrences Post 302977631 by p1ne on Wednesday 20th of July 2016 05:26:43 PM
Old 07-20-2016
Hi, thanks for responding,
Code:
sed (GNU sed) 4.2.2

No, dots are not replaced. The idea is to put random paragraph breaks in a chunk of text, every 5 - 10 sentences, for example.

Yes I'm open to any other method.

Last edited by p1ne; 07-20-2016 at 06:32 PM..
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

removing the "\" and "\n" character using sed or tr

Hi All, I'm trying to write a ksh script to parse a file. When the "\" character is encountered, it should be removed and the next line should be concatenated with the current line. For example... this is a test line #1\ should be concatenated with line #2\ and line number 3 when this... (3 Replies)
Discussion started by: newbie_coder
3 Replies

2. Shell Programming and Scripting

cat $como_file | awk /^~/'{print $1","$2","$3","$4}' | sed -e 's/~//g'

hi All, cat file_name | awk /^~/'{print $1","$2","$3","$4}' | sed -e 's/~//g' Can this be done by using sed or awk alone (4 Replies)
Discussion started by: harshakusam
4 Replies

3. UNIX for Dummies Questions & Answers

Command Character size limit in the "sh" and "bourne" shell

Hi!!.. I would like to know what is maximum character size for a command in the "sh" or "bourne" shell? Thanks in advance.. Roshan. (1 Reply)
Discussion started by: Roshan1286
1 Replies

4. UNIX for Advanced & Expert Users

Command Character size limit in the "sh" and "bourne" shell

Hi!!.. I would like to know what is maximum character size for a command in the "sh" or "bourne" shell? Thanks in advance.. Roshan. (1 Reply)
Discussion started by: Roshan1286
1 Replies

5. Shell Programming and Scripting

Command Character size limit in the "sh" and "bourne" shell

Hi!!.. I would like to know what is maximum character size for a command in the "sh" or "bourne" shell? Thanks in advance.. Roshan. (1 Reply)
Discussion started by: Roshan1286
1 Replies

6. Shell Programming and Scripting

How to print range of lines using sed when pattern has special character "["

Hi, My input has much more lines, but few of them are below pin(IDF) { direction : input; drc_pinsigtype : signal; pin(SELDIV6) { direction : input; drc_pinsigtype : ... (3 Replies)
Discussion started by: nehashine
3 Replies

7. Shell Programming and Scripting

sed escape character for comment string "/*"

Good afternoon all, I'm hoping my newbie question can help bolster someone's street_cred.sh today. I'm trying to "fingerprint" SQL on its way into the rdbms for a benchmarking process (so I can tie the resource allocation back to the process more precisely). To do this, I'm essentially... (4 Replies)
Discussion started by: toeharp
4 Replies

8. Shell Programming and Scripting

Using sed to find text between a "string " and character ","

Hello everyone Sorry I have to add another sed question. I am searching a log file and need only the first 2 occurances of text which comes after (note the space) "string " and before a ",". I have tried sed -n 's/.*string \(*\),.*/\1/p' filewith some, but limited success. This gives out all... (10 Replies)
Discussion started by: haggismn
10 Replies

9. Shell Programming and Scripting

how to use "cut" or "awk" or "sed" to remove a string

logs: "/home/abc/public_html/index.php" "/home/abc/public_html/index.php" "/home/xyz/public_html/index.php" "/home/xyz/public_html/index.php" "/home/xyz/public_html/index.php" how to use "cut" or "awk" or "sed" to get the following result: abc abc xyz xyz xyz (8 Replies)
Discussion started by: timmywong
8 Replies

10. Shell Programming and Scripting

Replacing character "|" in given character range

Hi I am having file : 1|2443094 |FUNG SIU TO |CLEMENT 2|2443095 |FUNG KIL FO |REMENT This file contains only 3 fields delimeted by "|". Last field is a decsription filed and it contains character "|". Due to this my output if breaking in 4 fields. I... (7 Replies)
Discussion started by: krsnadasa
7 Replies
Text::Greeking(3pm)					User Contributed Perl Documentation				       Text::Greeking(3pm)

NAME
Text::Greeking - a module for generating meaningless text that creates the illusion of the finished document. SYNOPSIS
#!/usr/bin/perl -w use strict; use Text::Greeking; my $g = Text::Greeking->new; $g->paragraphs(1,2) # min of 1 paragraph and a max of 2 $g->sentences(2,5) # min of 2 sentences per paragraph and a max of 5 $g->words(8,16) # min of 8 words per sentence and a max of 16 print $g->generate; # use default Lorem Ipsum source DESCRIPTION
Greeking is the use of random letters or marks to show the overall appearance of a printed page without showing the actual text. Greeking is used to make it easy to judge the overall appearance of a document without being distracted by the meaning of the text. This is a module is for quickly generating varying meaningless text from any source to create this illusion of the content in systems. This module was created to quickly give developers simulated content to fill systems with simulated content. Instead of static Lorem Ipsum text, by using randomly generated text and optionally varying word sources, repetitive and monotonous patterns that do not represent real system usage is avoided. METHODS
Text::Greeking->new Constructor method. Returns a new instance of the class. $g->init Initializes object with defaults. Called by the constructor. Broken out for easy overloading to enable customized defaults and other behaviour. $g->sources([@ARRAY]) Gets/sets the table of source word collections current in memory as an ARRAY reference $g->add_source($text) The class takes a body of text passed as a SCALAR and processes it into a list of word tokens for use in generating random filler text later. $g->generate Returns a body of random text generated from a randomly selected source using the minimum and maximum values set by paragraphs, sentences, and words minimum and maximum values. If generate is called without any sources a standard Lorem Ipsum block is used added to the sources and then used for processing the random text. $g->paragraphs($min,$max) Sets the minimum and maximum number of paragraphs to generate. Default is a minimum of 2 and a maximum of 8. $g->sentences($min,$max) Sets the minimum and maximum number of sentences to generate per paragraph. Default is a minimum of 2 and a maximum of 8. $g->words($min,$max) Sets the minimum and maximum number of words to generate per sentence. Default is a minimum of 5 and a maximum of 15. SEE ALSO
http://en.wikipedia.org/wiki/Greeking TO DO
HTML output mode including random hyperlinked phrases. Configurable punctuation controls. PARTICIPATION
I welcome and accept patches in diff format. If you wish to hack on this code, please fork the git repository found at: <http://github.com/tima/perl-text-greeking/>. If you have something to push back to my repository, just use the "pull request" button on the github site. LICENSE
The software is released under the Artistic License. The terms of the Artistic License are described at <http://www.perl.com/language/misc/Artistic.html>. AUTHOR &; COPYRIGHT Except where otherwise noted, Text::Greeking is Copyright 2005-2009, Timothy Appnel, tima@cpan.org. All rights reserved. perl v5.10.0 2009-08-28 Text::Greeking(3pm)
All times are GMT -4. The time now is 03:00 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy