Basically I have a text file that is made up of customer statements. I want to be able to separate the customer statements into their own file. The file is consistant in that the account # (part of the key) is always on line 10 then on every 55th line from there on out so my logic would be like: Read file put 10th line for charcters 1-5 in variable (account #), compare that to line 65 and if the same, read the next key (65 + 55), if they are different then take 10 lines less and write output using key plus date so key would be 90313.txt for Act 9 on March 2013 statement. I know how to use awk to get it to show x line like awk NR==10 example.txt but I need to know the script to keep this ongoing and to output each statement to its own file.
I have a text file which represent a http packet:
header1
haeder2
.....
.....
headern
payload
I need to count bytes in the payload. How can I get it using awk?
Thanks in advance
Andrea Musella (2 Replies)
I am definitely not an expert with awk, and I want to reformat a text file like the following. This is probably a very easy one for an expert out there. I would like to keep the lines in the same order, but move the heading to only be listed once above the lines.
This is what the text file... (7 Replies)
Hello friends!
Help me pls to write correct awk and grep statements for my task:
I have got files with name filename.txt
It has such structure:
Start of file
FROM: address@domen.com (12...890) abc
DATE: 11/23/2009 on Std
SUBJECT: any subject
End of file
So, I must check,
if this file... (4 Replies)
Looking for some help on using awk and cut
I have a text file that has fixed information and want to write a script that will prompt the user for an account to search for and pint the output
The sample line that has the key information looks like this:
Statement to: ... (5 Replies)
Hi ,
I have a simple text file with contents as below:
12345678900 971,76 4234560890
22345678900 5971,72 5234560990
32345678900 71,12 6234560190
the new csv-file should be like:
Column1;Column2;Column3;Column4;Column5
123456;78900;971,76;423456;0890... (9 Replies)
Hello,
Some time ago a helpful awk file was provided on the forum which I give below:
NR==FNR{A=$0;next}{for(j in A){split(A,P,"=");for(i=1;i<=NF;i++){if($i==P){$i=P}}}}1
While it works beautifully on English and Latin characters i.e. within the ASCII range of 127, the moment a character beyond... (6 Replies)
In the awk below I am trying to cp and paste each matching line in f2 to $3 in f1 if $2 of f1 is in the line in f2 somewhere. There will always be a match (usually more then 1) and my actual data is much larger (several hundreds of lines) in both f1 and f2. When the line in f2 is pasted to $3 in... (4 Replies)
hi all,
trying this using shell/bash with sed/awk/grep
I have two files, one containing one column, the other containing multiple columns (comma delimited).
file1.txt
abc12345
def12345
ghi54321
...
file2.txt
abc1,text1,texta
abc,text2,textb
def123,text3,textc
gh,text4,textd... (6 Replies)
Discussion started by: shogun1970
6 Replies
LEARN ABOUT REDHAT
rndc.conf
RNDC.CONF(5)RNDC.CONF(5)NAME
rndc.conf - rndc configuration file
SYNOPSIS
rndc.conf
DESCRIPTION
rndc.conf is the configuration file for rndc, the BIND 9 name server control utility. This file has a similar structure and syntax to
named.conf. Statements are enclosed in braces and terminated with a semi-colon. Clauses in the statements are also semi-colon terminated.
The usual comment styles are supported:
C style: /* */
C++ style: // to end of line
Unix style: # to end of line
rndc.conf is much simpler than named.conf. The file uses three statements: an options statement, a server statement and a key statement.
The options statement contains three clauses. The default-server clause is followed by the name or address of a name server. This host
will be used when no name server is given as an argument to rndc. The default-key clause is followed by the name of a key which is identi-
fied by a key statement. If no keyid is provided on the rndc command line, and no key clause is found in a matching server statement, this
default key will be used to authenticate the server's commands and responses. The default-port clause is followed by the port to connect to
on the remote name server. If no port option is provided on the rndc command line, and no port clause is found in a matching server state-
ment, this default port will be used to connect.
After the server keyword, the server statement includes a string which is the hostname or address for a name server. The statement has two
possible clauses: key and port. The key name must match the name of a key statement in the file. The port number specifies the port to con-
nect to.
The key statement begins with an identifying string, the name of the key. The statement has two clauses. algorithm identifies the encryp-
tion algorithm for rndc to use; currently only HMAC-MD5 is supported. This is followed by a secret clause which contains the base-64 encod-
ing of the algorithm's encryption key. The base-64 string is enclosed in double quotes.
There are two common ways to generate the base-64 string for the secret. The BIND 9 program rndc-confgen can be used to generate a random
key, or the mmencode program, also known as mimencode, can be used to generate a base-64 string from known input. mmencode does not ship
with BIND 9 but is available on many systems. See the EXAMPLE section for sample command lines for each.
EXAMPLE
options {
default-server localhost;
default-key samplekey;
};
server localhost {
key samplekey;
};
key samplekey {
algorithm hmac-md5;
secret "c3Ryb25nIGVub3VnaCBmb3IgYSBtYW4gYnV0IG1hZGUgZm9yIGEgd29tYW4K";
};
In the above example, rndc will by default use the server at localhost (127.0.0.1) and the key called samplekey. Commands to the localhost
server will use the samplekey key, which must also be defined in the server's configuration file with the same name and secret. The key
statement indicates that samplekey uses the HMAC-MD5 algorithm and its secret clause contains the base-64 encoding of the HMAC-MD5 secret
enclosed in double quotes.
To generate a random secret with rndc-confgen:
rndc-confgen
A complete rndc.conf file, including the randomly generated key, will be written to the standard output. Commented out key and controls
statements for named.conf are also printed.
To generate a base-64 secret with mmencode:
echo "known plaintext for a secret" | mmencode
NAME SERVER CONFIGURATION
The name server must be configured to accept rndc connections and to recognize the key specified in the rndc.conf file, using the controls
statement in named.conf. See the sections on the controls statement in the BIND 9 Administrator Reference Manual for details.
SEE ALSO rndc(8), rndc-confgen(8), mmencode(1), BIND 9 Administrator Reference Manual.
AUTHOR
Internet Software Consortium
BIND9 June 30, 2000 RNDC.CONF(5)