It does. Please apply what has been said to the repective line:
Is that clearer now? If you want to remove the leading space from field 1, additional measures must be taken.
OK, thank you so much. I was under the impression that the field separator value was set to the *string* "][" rather than "]" or "[", thus I thought that $1 in the code would have been PS028,006 [KJ <Cj>, rather than PS028,006. This was very helpful. Thank you for taking the time to explain this.
I'm at wits end with this issue and my troubleshooting leads me to believe it is a problem with the file formatting of the array referenced by my script:
awk -F, '{if (NR==FNR) {a=$4","$3","$2}\
else {print a "," $0}}' WBTSassignments1.txt RNCalarms.tmp
On the WBTSassignments1.txt file... (2 Replies)
Hello, I am using awk to match text in a tab separated field and am able to do so when matching the exact word. My problem is that I would like to match any sequence of text in the tab-separated field without having to match it all. Any help will be appreciated. Please see the code below.
awk... (3 Replies)
i have a file like this
< '393200103052';'H3G';'20081204'
< '393200103059';'TIM';'20110111'
< '393200103061';'TIM';'20060206'
< '393200103064';'OPI';'20110623'
> '393200103052';'HKG';'20081204'
> '393200103056';'TIM';'20110111'
> '393200103088';'TIM';'20060206'
Now i have to generate a file... (9 Replies)
attempting the hangman program. This was an optional assignment from the professor. I have completed the logical coding, debugging now.
##I have an array $wordString that initializes to a string of dashes
##reflecting the number of letters in $theWord
##every time the user enters a (valid)... (5 Replies)
Hi All,
I got stuck up with shell script where i use awk. The scenario which i am working on is as below.
I have a file text.txt with contents
COL1 COL2 COL3 COL4
1 A 500 400
1 B 500 400
1 A 500 200
2 A 290 300
2 B 290 280
3 C 100 100
I could able to sum col 3 and col4 based on... (3 Replies)
here is what i want to achieve... consider a file contains below contents. the file size is large about 60mb
cat dump.sql
INSERT INTO `table1` (`id`, `action`, `date`, `descrip`, `lastModified`) VALUES (1,'Change','2011-05-05 00:00:00','Account Updated','2012-02-10... (10 Replies)
Hi
Input:
{ committed = 782958592; init = 805306368; max = 1051394048; used = 63456712; }
Result:
A map (maybe Associative Array) where I can iterate through the key/value. Something like this:
for key in $map
do
echo key=$key value=$map
done
Sample output from the map:
... (2 Replies)
Is there a reliable way to deal with whitespace in array indicies?
I am trying to annotate fails in a database using a table of known fails.
In a begin block I have code like this:
# Read in Known Fail List
getline < "'"$failListFile"'"; getline < "'"$failListFile"'"; getline <... (6 Replies)
Hi,
I am trying to read an Oracle listener log file line by line and need to separate the lines into several fields. The field delimiter for the line happens to be an asterisk.
I have the script below to start with but when running it, the echo command is globbing it to include other... (13 Replies)
In the awk below I am trying to get the average of the sum of $7 if the string in $4 matches in the line below it. The --- in the desired out is not needed, it is just to illustrate the calculation. The awk executes and produces the current out. I am not sure why the middle line is skipped and the... (2 Replies)
Discussion started by: cmccabe
2 Replies
LEARN ABOUT DEBIAN
snsplit
snsplit,v0.3.8(8) System Manager's Manual snsplit,v0.3.8(8)NAME
snsplit - split an article stream into individual articles
SYNOPSIS
snsplit [-r] [field... -] prog...
DESCRIPTION
snsplit reads an article stream from descriptor 0 and splits it into separate articles, invoking prog... on each, with the article ava-
iable on descriptor 0. This is useful as a quick-and-dirty way of filtering an article stream.
The incoming article stream is expected to be in wire format, with lines ending in CRLF, leading dots doubled, and delimited by a dot on a
line by itself.
The article presented to prog... will have lines that end in a bare newline, will have all header lines unfolded, leading dots will be
unstuffed, and the article will be terminated by end-of-file.
ARGUMENTS
prog...
is the program (with arguments) to run on each article. If prog... exits with any kind of failure, snsplit aborts.
field...-
are optional header field names. If these are specified, the value of the first header field of that name will be exported into the
environment. This field... list must be terminated by the hyphen. See also ENVIRONMENT below.
OPTIONS -r Expect input articles in rnews batch format instead.
ENVIRONMENT
snsplit sets some environment variables. If the environment already contains these variables, they will be overwritten.
SEQUENCE
If already set to a positive value, it is incremented for the first article. If it isn't set, is set to one for the first article.
Thereafter it is incremented for each subsequent article. The value is always a 6-digit number with leading zeroes, and it can roll
over.
BYTES contains the size of the current article.
HEAD_LINES
The number of lines in the head of the article, excluding the blank separator line.
BODY_LINES
The number of lines in the body of the article, excluding the blank separator line.
FLD_FIELD
If any fields are specified on the command line, where field is the name of an article header field, then FLD_FIELD will be set to
the value of field, where FIELD is the same as field but with lower case characters changed to upper case, and all hyphens changed
to underscores. Confusing? If field is message-id, then FLD_MESSAGE_ID will be set to the value of the first Message-ID field in
the current article, if there is one.
EXIT CODES
snsplit exits 0 on success, 1 on usage error, 2 on system error, and 3 on article format error. If prog... exits with other than 0,
snsplit will also exit that value.
N.B. Harold Tay snsplit,v0.3.8(8)