Sponsored Content
Top Forums Shell Programming and Scripting Parsing a name Value pair file Post 302955017 by mksuneel on Monday 14th of September 2015 07:24:24 AM
Old 09-14-2015
Parsing a name Value pair file

Hi,

I have a file having rows as

Row1 : model=.1.3.6.1.4.1.9.1.1047,location=abc, pollgrp=PG_CISCO4, ifindex=3, ip=10.10.10.1,parttype=Interface, devtype=Router,part=GigabitEthernet0/1,ifmtu=1520
Row2 : model=.1.3.6.1.4.1.9.1.2047,pollgrp=PG_ABCD4,ifindex=3,contact=LMN,ip=20.20.20.1,devtype=Router,ifmt u=2345
Row3:model=.1.3.6.1.4.1.9.1.3047,location=xyz,devtype=route,dwelf=xxxx

I need output as below
Code:
model;location;pollgrp;ifindex;contact;ip;parttype;devtype;part;ifmtu;dwelf
.1.3.6.1.4.1.9.1.1047;abc;PG_CISCO4;3;;10.10.10.1;Interface;Router;GigabitEthernet0/1;1520;
.1.3.6.1.4.1.9.1.2047;;PG_ABCD4;3;LMN;20.20.20.1;;Router;;2345;
.1.3.6.1.4.1.9.1.3047;xyz;;;;;;route;;;xxxx

Can someone help me out?

Last edited by vbe; 09-14-2015 at 09:28 AM..
 

8 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Parsing of file for Report Generation (String parsing and splitting)

Hey guys, I have this file generated by me... i want to create some HTML output from it. The problem is that i am really confused about how do I go about reading the file. The file is in the following format: TID1 Name1 ATime=xx AResult=yyy AExpected=yyy BTime=xx BResult=yyy... (8 Replies)
Discussion started by: umar.shaikh
8 Replies

2. Shell Programming and Scripting

Parsing with Name value pair and creating a normalized file

I have url string as follows and I need to parse the name value pair into fields /rows event_id date time payload 1329130951 20120214 22.30.40... (1 Reply)
Discussion started by: smee
1 Replies

3. Shell Programming and Scripting

Sort files as pair file

Hello, I am wondering if there is a way to sort file in directory by pair name : I am looking to get the extension .txt above the .archlike this if possible liste_NATIVE_HINDCAST_PSY1V2R2_R20120314.txt flag.NATIVE_HINDCAST_PSY1V2R2.R20120314.arch... (4 Replies)
Discussion started by: Aswex
4 Replies

4. AIX

How to find pair VIOS?

Hi, I have the scenario, that there 3 VIOS in a Frame in this 2 are in dual VIOS My question is how to find which VIOS are in dual? Also, any vios command to identify the pair member (hostname) of a dual VIOS Regards, Siva (3 Replies)
Discussion started by: ksgnathan
3 Replies

5. Shell Programming and Scripting

Pair wise comparisons

Hi, I have 25 groups and I need to perform all possible pairwise compariosns between them using the formula n(n-1)/2. SO in my case it will be 25(25-1)/2 which is equal to 300 comparisons. my 25 groups are FG1 FG2 FG3 FG4 FG5 NT5E CD44 CD44 CD44 AXL ADAM19 CCDC80 L1CAM L1CAM CD44... (1 Reply)
Discussion started by: Diya123
1 Replies

6. UNIX for Dummies Questions & Answers

Deleting a file with no corresponding pair

Hi, I am working with 2 sets of files (*csv and *asc) and I wanted to delete asc file with no corresponding csv counterpart. I did tried it manually but its been difficult working with a longer list of files. sample files in directory 20120601.csv 20120601_f1.asc 20120603.csv 20120602_f1.asc... (3 Replies)
Discussion started by: ida1215
3 Replies

7. Shell Programming and Scripting

awk name pair values

Team, I have a file like below FILE: NAM1,KEY1,VAL1 NAM1,KEY2,VAL2 NAM1,KEY3,VAL3 NAM2,KEY1,VALA NAM2,KEY2,VALB NAM2,KEY3,VALCOutput: I have to build commands like below <Script> VAL1 VAL2 VAL3 NAME1 <Script> VALA VALB VALC NAME2Can you please help with awk command i can use... (4 Replies)
Discussion started by: mallak
4 Replies

8. Programming

Calculate ratios for each pair in a given file

Hello, My input file looks like this #CHROM POS ID REF ALT QUAL FILTER INFO FORMAT Individual1 Individual2 Individual3 Individual4 Individual5 Individual6 22 10000 ID1 A ... (0 Replies)
Discussion started by: nans
0 Replies
RTSOLD(8)						    BSD System Manager's Manual 						 RTSOLD(8)

NAME
rtsold -- router solicitation daemon SYNOPSIS
rtsold [-dDfm1] interface ... rtsold [-dDfm1] -a rtsol [-dD] interface ... rtsol [-dD] -a DESCRIPTION
rtsold is the daemon program to send ICMPv6 Router Solicitation messages on the specified interfaces. If a node (re)attaches to a link, rtsold sends some Router Solicitations on the link destined to the link-local scope all-routers multicast address to discover new routers and to get non link-local addresses. rtsold should be used on IPv6 hosts (non-router nodes) only. If you invoke the program as rtsol, it will transmit probes from the specified interface, without becoming a daemon. In other words, rtsol behaves as ``rtsold -f1 interfaces''. Specifically, rtsold sends at most 3 Router Solicitations on an interface after one of the following events: o Just after invocation of rtsold daemon. o The interface is up after a temporary interface failure. rtsold detects such failures by periodically probing to see if the status of the interface is active or not. Note that some network cards and drivers do not allow the extraction of link state. In such cases, rtsold cannot detect the change of the interface status. o Every 60 seconds if the -m option is specified and the rtsold daemon cannot get the interface status. This feature does not conform to the IPv6 neighbor discovery specification, but is provided for mobile stations. The default interval for router advertisements, which is on the order of 10 minutes, is slightly long for mobile stations. This feature is provided for such stations so that they can find new routers as soon as possible when they attach to another link. Once rtsold has sent a Router Solicitation, and has received a valid Router Advertisement, it refrains from sending additional solicitations on that interface, until the next time one of the above events occurs. When sending a Router Solicitation on an interface, rtsold includes a Source Link-layer address option if the interface has a link-layer address. Upon receipt of signal SIGUSR1, rtsold will dump the current internal state into /var/run/rtsold.dump. OPTIONS
-a Autoprobe outgoing interface. rtsold will try to find a non-loopback, non-point-to-point, IPv6-capable interface. If rtsold finds multiple interfaces, rtsold will exit with error. -d Enable debugging. -D Enable more debugging including the printing of internal timer information. -f -f prevents rtsold from becoming a daemon (foreground mode). Warning messages are generated to standard error instead of syslog(3). -m Enable mobility support. If this option is specified, rtsold sends probing packets to default routers that have advertised Router Advertisements when the node (re)attaches to an interface. Moreover, if the option is specified, rtsold periodically sends Router Solicitation on an interface that does not support SIOCGIFMEDIA ioctl. -1 Perform only one probe. Transmit Router Solicitation packets until at least one valid Router Advertisement packet has arrived on each interface, then exit. DIAGNOSTICS
The rtsold utility exits 0 on success, and >0 if an error occurs. FILES
/var/run/rtsold.pid the pid of the currently running rtsold. /var/run/rtsold.dump dumps internal state on. SEE ALSO
rtadvd(8), sysctl(8) HISTORY
The rtsold command is based on the rtsol command, which first appeared in WIDE/KAME IPv6 protocol stack kit. rtsol is now integrated into rtsold(8). BUGS
In some operating systems, when a PCMCIA network card is removed and reinserted, the corresponding interface index is changed. However, rtsold assumes such changes will not occur, and always uses the index that it got at invocation. As a result, rtsold may not work if you reinsert a network card. In such a case, rtsold should be killed and restarted. The IPv6 autoconfiguration specification assumes a single-interface host. You may see kernel error messages if you try to autoconfigure a host with multiple interfaces. Also, it seems contradictory for rtsold to accept multiple interface arguments. BSD
May 17, 1998 BSD
All times are GMT -4. The time now is 07:45 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy