01-30-2011
Easy way to pull a paragraph from a text file?
I have a collection of text files that comprise a mailing list archive. I grep them to find an email that interests me, then open the file in a text editor to find the surrounding paragraph of text. Is there an easy way to do this from the shell instead?
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
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)
Discussion started by: tricky
5 Replies
2. Shell Programming and Scripting
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)
Discussion started by: uvrakesh
1 Replies
3. UNIX for Dummies Questions & Answers
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)
Discussion started by: EugeneG
4 Replies
4. Shell Programming and Scripting
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)
Discussion started by: xajax7
13 Replies
5. Shell Programming and Scripting
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)
Discussion started by: TECK
6 Replies
6. Shell Programming and Scripting
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)
Discussion started by: prachiagra
3 Replies
7. Shell Programming and Scripting
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)
Discussion started by: kuliksco
5 Replies
8. UNIX for Dummies Questions & Answers
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)
Discussion started by: carpenn
2 Replies
9. Shell Programming and Scripting
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)
Discussion started by: chango77747
6 Replies
10. Shell Programming and Scripting
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
locale::po4a::text
Locale::Po4a::Text(3) User Contributed Perl Documentation Locale::Po4a::Text(3)
NAME
Locale::Po4a::Text - convert text documents from/to PO files
DESCRIPTION
The po4a (PO for anything) project goal is to ease translations (and more interestingly, the maintenance of translations) using gettext
tools on areas where they were not expected like documentation.
Locale::Po4a::Text is a module to help the translation of text documents into other [human] languages.
Paragraphs are split on empty lines (or lines containing only spaces or tabulations).
If a paragraph contains a line starting by a space (or tabulation), this paragraph won't be rewrapped.
OPTIONS ACCEPTED BY THIS MODULE
These are this module's particular options:
nobullets
Deactivate detection of bullets.
By default, when a bullet is detected, the bullet paragraph is not considered as a verbatim paragraph (with the no-wrap flag in the PO
file), but the module rewraps this paragraph in the generated PO file and in the translation.
tabs=mode
Specify how tabulations shall be handled. The mode can be any of:
split
Lines with tabulations introduce breaks in the current paragraph.
verbatim
Paragraph containing tabulations will not be re-wrapped.
By default, tabulations are considered as spaces.
breaks=regex
A regular expression matching lines which introduce breaks. The regular expression will be anchored so that the whole line must match.
debianchangelog
Handle the header and footer of released versions, which only contain non translatable informations.
fortunes
Handle the fortunes format, which separate fortunes with a line which consists in '%' or '%%', and use '%%' as the beginning of a
comment.
markdown
Handle some special markup in Markdown-formatted texts.
asciidoc
Handle documents in the AsciiDoc format.
control[=taglist]
Handle control files. A comma-separated list of tags to be translated can be provided.
STATUS OF THIS MODULE
Tested successfully on simple text files and NEWS.Debian files.
AUTHORS
Nicolas Francois <nicolas.francois@centraliens.net>
COPYRIGHT AND LICENSE
Copyright 2005-2008 by Nicolas FRANCOIS <nicolas.francois@centraliens.net>.
This program is free software; you may redistribute it and/or modify it under the terms of GPL (see the COPYING file).
perl v5.14.2 2012-05-17 Locale::Po4a::Text(3)