Sponsored Content
Full Discussion: Pick and print fields..
Top Forums UNIX for Dummies Questions & Answers Pick and print fields.. Post 302652919 by vanand420 on Friday 8th of June 2012 11:10:08 AM
Old 06-08-2012
Pick and print fields..

HI,
I am having a requirement to check the unavailabilty of signling links. Please help.

Thanks in advance.

I need to have output like this :

Code:
OPC=2-16-1 APC=2-14-7 12  1 12-05-01 TIME=03:49:03 12-05-01 TIME=03:53:36

Input file:
Code:
   +++ KYM 12-05-01 03:49:03 MTCE 3484 #624349 >
** REPT CSLK  TYPE=CNATL  SM=2  OPC=2-16-1     TIME=03:49:03
            12  1  UNAVAIL  AUTO  MTCE  LKER-L2    
            EXCESS ERROR RATE - SUERM
             
                         
     APC=2-14-7  SLC=1
   END OF REPORT #624349 ++-

   +++ KYM 12-05-01 03:55:13 MTCE 3484 #624842 >
   REPT CCSLK  TYPE=C7NATL  SM=2  OPC=2-16-1     TIME=03:53:36
            12  1  AVAIL  AUTO        MAX SIF=272 OCTETS
            
     SM=2  PSUPH=2-1-14    SM=2  DEN=2-0-61
                         
     APC=2-14-7  SLC=1
   END OF REPORT #624842 ++-

---------- Post updated at 08:40 PM ---------- Previous update was at 03:08 PM ----------

Hi,

Let us reduce the problem to one leg only. Please suggest how it can be fetched.

Output :
Code:
OPC=2-16-1 APC=2-14-7 UNAVAIL LKER-L2 12  1 12-05-01 TIME=03:49:03

Input :
Code:
   +++ KYM 12-05-01 03:49:03 MTCE 3484 #624349 >
** REPT CSLK  TYPE=CNATL  SM=2  OPC=2-16-1     TIME=03:49:03
            12  1  UNAVAIL  AUTO  MTCE  LKER-L2    
            EXCESS ERROR RATE - SUERM
             
                         
     APC=2-14-7  SLC=1
   END OF REPORT #624349 ++-


Last edited by Scrutinizer; 06-08-2012 at 06:55 AM.. Reason: code tags
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

print last 2 fields of a line

Hi everyone, happy new year! Can someone teach me how I can print the last 2 fields of every line in a file (lines don't have uniform number of fields), for example: input file: aaa bbb ccc ddd eee fff ggg hhh iii jjj kkk lll mmm nnn ooo output: ccc ddd fff ggg iii jjj nnn ooo ... (2 Replies)
Discussion started by: Deanne
2 Replies

2. Shell Programming and Scripting

Print all the fields of record using awk

Hi, i want to generate print statement using awk. i have 20+ and 30+ fields in each line Now its priting only first eight fields print statement as output not all. my record is as shown below filename ... (2 Replies)
Discussion started by: raghavendra.nsn
2 Replies

3. Shell Programming and Scripting

awk - print all fields except for last field

How do I print all the fields of a record except for the $(NF) field? (4 Replies)
Discussion started by: locoroco
4 Replies

4. Shell Programming and Scripting

How to print selected fields

HI, I am using below command to display the words, but i am getting awk error. Please help me out on this I am using below code i am getting error as If i use below code i am getting below OP Output from where i am trying to select the fields after delimiter "," from here i want to... (5 Replies)
Discussion started by: darling
5 Replies

5. Shell Programming and Scripting

Pick and print

Hi Friends, I'm facing an issue. I am having a file as under : a1 b1 c1 a2 a3 a4 b4 a5 b5 and I need to get the output as under: a1 b1 a4 b4 a5 b5 i.e. to pick the columns where a and b are consecutive and ignoring rest. I was trying some thing sily as: (2 Replies)
Discussion started by: vanand420
2 Replies

6. Shell Programming and Scripting

How to print 1st field and last 2 fields together and the rest of the fields after it using awk?

Hi experts, I need to print the first field first then last two fields should come next and then i need to print rest of the fields. Input : a1,abc,jsd,fhf,fkk,b1,b2 a2,acb,dfg,ghj,b3,c4 a3,djf,wdjg,fkg,dff,ggk,d4,d5 Expected output: a1,b1,b2,abc,jsd,fhf,fkk... (6 Replies)
Discussion started by: 100bees
6 Replies

7. Shell Programming and Scripting

awk sort based on difference of fields and print all fields

Hi I have a file as below <field1> <field2> <field3> ... <field_num1> <field_num2> Trying to sort based on difference of <field_num1> and <field_num2> in desceding order and print all fields. I tried this and it doesn't sort on the difference field .. Appreciate your help. cat... (9 Replies)
Discussion started by: newstart
9 Replies

8. Shell Programming and Scripting

awk print even fields of file

Hello: I want to print out the even number of fields plus the first column as row identifiers. input.txt ID X1 ID X2 ID X3 ID X4 A 700 A 1200 A 400 A 1300 B 2000 B 1000 B 2000 B 600 C 1400 C 200 C 1000 C 1200 D 1300 D 500 D 600 D 200and the output is: output.txt ID X1 X2 X3... (3 Replies)
Discussion started by: yifangt
3 Replies

9. Shell Programming and Scripting

Print . in blank fields to prevent fields from shifting

The below code works great, kindly provided by @Don Cragun, the lines in bold print the current output. Since some of the fields printed can be blank some of the fields are shifted. I can not seem too add . to the blank fields like in the desired output. Basically, if there is nothing in the field... (10 Replies)
Discussion started by: cmccabe
10 Replies

10. UNIX for Beginners Questions & Answers

How to print lines from a files with specific start and end patterns and pick only the last lines?

Hi, I need to print lines which are matching with start pattern "SELECT" and END PATTERN ";" and only select the last "select" statement including the ";" . I have attached sample input file and the desired input should be as: INPUT FORMAT: SELECT ABCD, DEFGH, DFGHJ, JKLMN, AXCVB,... (5 Replies)
Discussion started by: nani2019
5 Replies
ttk::frame(n)							 Tk Themed Widget						     ttk::frame(n)

__________________________________________________________________________________________________________________________________________________

NAME
ttk::frame - Simple container widget SYNOPSIS
ttk::frame pathName ?options? _________________________________________________________________ DESCRIPTION
A ttk::frame widget is a container, used to group other widgets together. STANDARD OPTIONS
-class -cursor -takefocus -style See the ttk_widget manual entry for details on the standard options. WIDGET-SPECIFIC OPTIONS [-borderwidth borderWidth] The desired width of the widget border. Defaults to 0. [-relief relief] One of the standard Tk border styles: flat, groove, raised, ridge, solid, or sunken. Defaults to flat. [-padding padding] Additional padding to include inside the border. [-width width] If specified, the widget's requested width in pixels. [-height height] If specified, the widget's requested height in pix- els. WIDGET COMMAND
Supports the standard widget commands configure, cget, identify, instate, and state; see ttk::widget(n). NOTES
Note that if the pack, grid, or other geometry managers are used to manage the children of the frame, by the GM's requested size will nor- mally take precedence over the frame widget's -width and -height options. pack propagate and grid propagate can be used to change this. SEE ALSO
ttk::widget(n), ttk::labelframe(n), frame(n) KEYWORDS
widget, frame, container Tk 8.5 ttk::frame(n)
All times are GMT -4. The time now is 03:27 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy