Greetings,
I would like to extract records from a fixed width text file that have unique field elements.
Data is structured like this:
John A Smith NY
Mary C Jones WA
Adam J Clark PA
Mary Jones WA
Fieldname / start-end position
Firstname 1-10... (8 Replies)
I am trying to parse a Fixed width file with data as below. I am trying to assign column values from each record to variables. When I parse the data, the spaces in all coumns are dropped. I would like to retain the spaces as part of the dat stored in the variables. Any help is appreciated.
I... (4 Replies)
Hi, I have two files.
File1:
File1 contains two fixed width columns ID of 15 characters length and Name is of 100 characters length.
ID Name
1-43<<11 spaces>>Swapna<<94 spaces>>
1-234<<10 spaces>>Mani<<96 spaces>>
1-3456<<9 spaces>>Kapil<<95 spaces>>
File2:
... (4 Replies)
Hi, I have two input files.
File1:
ID Name Place
1-234~name1~Newyork
1-34~name2~Boston
1-2345~name3~Hungary
File1 is a variable length file where each column is seperated by delimitter "~".
File2:
ID Country
1-34<<11 SPACES>>USA<<7 spaces>>
1-234<<10 SPACES>>UK<<8... (5 Replies)
Hi,
I have a fixed width file with some records as given below:
" 1000Nalsdjflj243324jljlj"
"-0300Njfowjljl309933fsf"
" 0010Njsfsjklj342344fsl"
I want to sum-up first field values(i.e from 2nd character to 6th character)of each record.
so for the above file i want to add (1000 - 300+... (2 Replies)
Hi everyone,
I have been working on a pretty laborious shellscript (with bash) the last couple weeks that parses my firewall policies (from a Juniper) for me and creates a nifty little columned output. It does so using awk on a line by line basis to pull out the appropriate pieces of each... (4 Replies)
I am trying to selectively display several columns from a db2 query, which gives me a fixed-width output (partial output listed here):
--------- -------------------------- ------------ ------
000 0000000000198012 702 29
000 0000000000198013 ... (9 Replies)
I would like to use printf (or something else?) to create a line of text that has varying column widths. This will be used to create a fixed width file (with varying column widths). For example, consider variables $1 $2 $3 are equal to a, b, c respectively and they should be printed in column... (10 Replies)
Thank u so much .Its working fine as expected.
---------- Post updated at 03:41 PM ---------- Previous update was at 01:46 PM ----------
I need one more help.
I have another file(fixed length) that will get negative value (ex:-00000000003000) in postion (98 - 112) then i have to... (6 Replies)
Discussion started by: vinus
6 Replies
LEARN ABOUT LINUX
tokenmt
tokenmt(7ipp) IP Quality of Service Modules tokenmt(7ipp)NAME
tokenmt - Single and Two Rate Three Conformance Level Meter
DESCRIPTION
The tokenmt module can be configured as a Single or a Two Rate meter. Packets are deemed to belong to one of the three levels - Red, Yellow
or Green - depending on the configured rate(s) and the burst sizes. When configured as a Single Rate meter, tokenmt can operate with just
the Green and Red levels.
Configuration parameters for tokenmt correspond to definitions in RFC- 2697 and RFC- 2698 as follows:
Configuring tokenmt as a Single Rate meter (from RFC- 2697):
committed_rate - CIR
committed_burst - CBS
peak_burst - EBS
(thus 'peak_burst' for a single rate meter is actually the 'excess burst' in the RFC. However, throughout the text the parameter name
"peak burst" is used.)
Configuring tokenmt as a Two Rate meter (from RFC- 2698):
committed_rate - CIR
peak_rate - PIR
committed_burst - CBS
peak_burst - PBS
The meter is implemented using token buckets C and P, which initially hold tokens equivalent to committed and peak burst sizes (bits)
respectively. When a packet of size B bits arrive at time t, the following occurs:
When operating as a Single Rate meter, the outcome (level)
is decided as follows:
- Update tokens in C and P
o Compute no. of tokens accumulated since the
last time packet was seen at the committed rate as
T(t) = committed rate * (t - t')
(where t' is the time the last packet was seen)
o Add T tokens to C up to a maximum of committed burst
size. Add remaining tokens ((C+T) - Commited Burst),
if any, to P, to a maximum of peak burst size.
- Decide outcome
o If not color aware
o If B <= C, outcome is GREEN and C -= B.
o Else, if B <= P, outcome is YELLOW and P -= B.
o Else, outcome is Red.
o Else,
o obtain DSCP from packet
o obtain color from color_map, color_map[DSCP]
o if (color is GREEN) and (B <= C), outcome is
GREEN and C -= B.
o Else, if (color is GREEN or YELLOW) and
(B <= P), outcome is YELLOW and P -= B.
o Else, outcome is RED.
Note that if peak_burst and yellow_next_actions are
not specified (that is, a single rate meter with two
outcomes), the outcome is never YELLOW.
When operating as a Two Rate meter, the outcome (level) is decided as follows:
- Update tokens in C and P
o Compute no. of tokens accumulated since the last time a
packet was seen at the committed and peak rates as
Tc(t) = committed rate * (t - t')
Tp(t) = peak rate * (t - t')
(where t' is the time the last packet was seen)
o Add Tc to C up to a maximum of committed burst size
o Add Tp to P up to a maximum of peak burst size
- Decide outcome
o If not color aware
o If B > P, outcome is RED.
o Else, if B > C, outcome is YELLOW and P -= B
o Else, outcome is GREEN and C -= B & P -= B
o Else,
o obtain DSCP from packet
o obtain color from color_map, color_map[DSCP]
o if (color is RED) or (B > P), outcome is RED
o Else, if (color is YELLOW) or (B > C),
outcome is YELLOW and P -= B
o Else, outcome is GREEN and C -= B & P -= B
STATISTICS
The tokenmt module exports the following statistics through kstat:
Global statistics:
module: tokenmt instance: <action id>
name: tokenmt statistics class <action name>
epackets <number of packets in error>
green_bits <number of bits in green>
green_packets <number of packets in green>
red_bits <number of bits in red>
red_packets <number of packets in red>
yellow_bits <number of bits in yellow>
yellow packets <number of packets in yellow>
FILES
/kernel/ipp/sparcv9/tokenmt
64-bit module (SPARC only.)
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Availability |SUNWqos |
+-----------------------------+-----------------------------+
SEE ALSO ipqosconf(1M), dlcosmk(7IPP), dscpmk(7IPP), flowacct(7IPP), ipqos(7IPP), ipgpc(7IPP), tswtclmt(7IPP)
RFC 2697, A Single Rate Three Color Marker J. Heinanen, R. Guerin -- The Internet Society, 1999
RFC 2698, A Two Rate Three Color Marker J. Heinanen, R. Guerin -- The Internet Society, 1999
SunOS 5.10 29 Sep 2004 tokenmt(7ipp)