05-15-2004
"Process the file line by line" is just the function of awk!
I think you must go over it.
FS="\n", such statement is used just when you want to process file paragraph by paragraph. It may formatted as below:
---------------------------------
#para1 as $1
hihi
king is a good boy.
I am home_king.
#para2 as $2
I am the east of the end.
Welcome to linuxsir.org
----------------------------------
then you can state that BEGIN{FS="\n",RS=""} :-)
Don't modify FS carelessly. By default, FS=[ \t].
8 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hello again,
Is there an option for the cp command to overwrite existing files in the destination directory?
Cheers
Rob (3 Replies)
Discussion started by: milage
3 Replies
2. UNIX for Dummies Questions & Answers
I am just beginning to learn unix and I was wondering if there was a list of all the options somewhere on the net or hidden in the man pages?
Also do options always have - and then a letter, or can it be - and a number as well? Thanks! (1 Reply)
Discussion started by: terms5
1 Replies
3. AIX
Hi All,
I have a situation here that's very fun...
I have a system with AIX and iPlanet (sunOne) installed, when occurs an unknown event on the network the WebServer shows a thousand of CLOSE_WAIT connections and this number grows and grows until the webserver crashs.
I read some documents... (2 Replies)
Discussion started by: nascimento.rp
2 Replies
4. Shell Programming and Scripting
My task is that when the user calls the script
1. If user calls script with
awk -v dtmax= -v stdlim= -f ../Scripts/add-rgauss-xt.awk fin.xt > fout.xt
rgauss will return mean + (stdlim * sigma)
2. If user calls script with
awk -v dtmax= -f ../Scripts/add-rgauss-xt.awk fin.xt > fout.xt... (4 Replies)
Discussion started by: kristinu
4 Replies
5. Shell Programming and Scripting
Hi,
I have a script that, basically, has two input files of this type:
file1
key1=value1_1_1
key2=value1_2_1
key4=value1_4_1
...
file2
key2=value2_2_1
key2=value2_2_2
key3=value2_3_1
key4=value2_4_1
...
My files are 10k lines big each (approx).
The keys are strings that don't... (7 Replies)
Discussion started by: fzd
7 Replies
6. Shell Programming and Scripting
Being new to awk I have a really basic question. It just has to be in the archives but it didn't bite me when I went looking for it.
I've written an awk script, placed it in a file, added the "#!/usr/bin/awk -f" at the top of the script and away I go. "% myAwk <inputfile>" gives me exactly what... (2 Replies)
Discussion started by: tomr2k
2 Replies
7. Ubuntu
Hello Everyone,
First of all, I highly appreciate all Linux forum members and whole Linux community. http://forums.linuxmint.com/images/smilies/icon_wink.gif. I wish you the best for all of you !
I will try to be short and concise: I am using Linux Mint 10 for 2 months on 2 ws, and all went... (3 Replies)
Discussion started by: cdt
3 Replies
8. Shell Programming and Scripting
I have written this code in an awk script.
BEGIN {
print "ARGV", ARGV
if ( match(ARGV,/-u/) || match(ARGV,/--usg/) ) {
print "MATCH -u:",match(ARGV,/-u/), RSTART, RLENGTH
print "MATCH --usg:",match(ARGV,/--usg/), RSTART, RLENGTH
usage()
exit(1)
}
}
I want... (7 Replies)
Discussion started by: kristinu
7 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)