If you want context around the line use the -A, -B, or -C options. For instance:
This will give you 50 lines of context around the line matched. Also, I like to use the --color=always option which gives me the lined matched in color red for easy identification.
Greetings.
I am struggling with a shell script to make my life simpler, with a number of practical ways in which it could be used. I want to take a standard text file, and pull the 'n'th word from each line such as the first word from a text file.
I'm struggling to see how each line can be... (5 Replies)
Hi All,
I want to extract last paragraph from a text for example
aaaaa
sadafsa
sdfdsaf
asfdsad
asfdsfad
asfdfsafd
adfssas
asdfsafdsa
asfdasdfa
sadfasdsaf
i need the last paragraph how to do it using linux commands (1 Reply)
Hi again. Sorry if it seems like I'm spamming the boards a bit, but I figured I might as well ask all the questions I need answers to at once, and hopefully at least get some.
I have installed Solaris 10 on a server. The default text editors are there (vi, ex, ed, maybe others, I know emacs is... (4 Replies)
hi all, iam new to awk & sed cmd and appreacite help from all the script expert from this forum, i have a file like below:
Fri Aug 01 00:01:19 2008
NAS-IP-Address = 172.16.160.1
Class = "P1-SHT-AAA01;1217116976;70999"
Calling-Station-Id = "00-11-FB-01-03-06"
Acct-Status-Type = Start... (13 Replies)
Hi all,
I have a bit of a problem with a loop that extracts repetitive text.
Running /bin/index executable outputs this text to terminal:
testing index 'scanthread'...
collected 0 docs, 0.0 MB
total 0 docs, 0 bytes
total 0.012 sec, 0 bytes/sec, 0.00 docs/sec
testing index 'scanpost'...... (6 Replies)
Hi all,
i'm new to this community. I am trying to write a script which will fetch ftp completion time of a file from a paragraph of a big text file ( which contains multiple paragraphs) . Each paragraph will have ftp details..
Now I dont know how to fetch process time within a paragraph of... (3 Replies)
Quick question...I'm trying to grab the .tif file name from this output from our fax server. What is the best way i can do this in a bash script? I have been looking at regular expressions with bash or using awk but having some trouble. thanks! The only output i want is... (5 Replies)
Hi, I'm trying to output all text from the first paragraph in a file that contains a specific string through the last paragraph in that file that contains that string.
Previously, I was outputting just each paragraph with that search string with:
cat in_file | nawk '{RS=""; FS="\n";... (2 Replies)
I am attempting to write a script that will pull out NTLM hashes from a text file that contains about 500,000 lines of data. Not all accounts contain hashes and I only need the ones that do contain hashes.
Here is a sample of what the data looks like:
There are thousands of other lines in... (6 Replies)
Hi,
I have a below text file, which needs to be printed into attached excel file. Please help me.
Thanks (4 Replies)
Discussion started by: prash358
4 Replies
LEARN ABOUT DEBIAN
text::flow::wrap
Text::Flow::Wrap(3pm) User Contributed Perl Documentation Text::Flow::Wrap(3pm)NAME
Text::Flow::Wrap - Flexible word wrapping for not just ASCII output.
SYNOPSIS
use Text::Flow::Wrap;
# for regular ASCII usage ...
my $wrapper = Text::Flow::Wrap->new(
check_width => sub { length($_[0]) < 70 },
);
# for non-ASCII usage ...
my $wrapper = Text::Flow::Wrap->new(
check_width => sub { $pdf->get_text_width($_[0]) < 500 },
);
my $text = $wrapper->wrap($text);
DESCRIPTION
The main purpose of this module is to provide text wrapping features without being tied down to ASCII based output and fixed-width fonts.
My needs were for sophisticated test control in PDF and GIF output formats in particular.
METHODS
new (%params)
This constructs a new Text::Flow::Wrap module whose %params set the values of the attributes listed below.
wrap ($text)
This method will accept a bunch of text, it will then return a new string which is wrapped to the expected width.
Attribute Accessors
check_width (&code)
This attribute is required, and must be a CODE reference. This will be used to determine if the width of the text is appropriate. It
will get as an argument, a string which is should check the width of. It should return a Boolean value, true if the string is not
exceeded the max width and false if it has.
line_break ($str)
This is the line break character used when assembling and disassembling the text, it defaults to the newline character "
".
paragraph_boundry ($str)
This is the paragraph boundry marker used when disassembling the text, it defaults to the string "
".
paragraph_break ($str)
This is the paragraph breaker used when re-assembling the text, it defaults to the string "
".
word_boundry ($str)
This is the word boundry marker used when disassembling the text, it defaults to a single space character.
word_break ($str)
This is the paragraph breaker used when re-assembling the text, it defaults to a single space character.
Paragraph Disassembling
These methods deal with breaking up the paragraphs into its parts, which can then be processed through the re-assembling methods.
These methods are mostly used internally, but more sophisticated tools might need to access them as well (see Text::Flow).
disassemble_paragraph
disassemble_paragraphs
Paragraph Reassembling
These methods deal with putting the paragraph parts back together after the disassembling methods have done thier work.
These methods are mostly used internally, but more sophisticated tools might need to access them as well (see Text::Flow)
reassemble_paragraph
reassemble_paragraphs
Introspection
meta
Returns the Moose meta object associated with this class.
BUGS
All complex software has bugs lurking in it, and this module is no exception. If you find a bug please either email me, or add the bug to
cpan-RT.
AUTHOR
Stevan Little <stevan@iinteractive.com>
COPYRIGHT AND LICENSE
Copyright 2007 by Infinity Interactive, Inc.
<http://www.iinteractive.com>
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
perl v5.10.1 2007-05-21 Text::Flow::Wrap(3pm)