Sponsored Content
Top Forums Shell Programming and Scripting Need help to manipulate data using script Post 302877173 by RudiC on Thursday 28th of November 2013 02:47:04 PM
Old 11-28-2013
Please use code tags as required by forum rules!

Try
Code:
awk '/name/ {getline name; next} NF {print $0, $1="Slno"?"name":name}' file
Slno vlan name
1 600 name
2 609 name
3 700 name
Slno vlan name
1 600 name
2 609 name
3 700 name

This User Gave Thanks to RudiC For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

sed or other tool to manipulate data, including email addresses

I have a list of names and email addresses, like this. The <tab> markers are actually tabs. joe.blow <tab> joe.blow@wherever.com tom.t.hall <tab> tom.t.hall@wherever.com john.r.smith <tab> john.r.smith@wherever.com sally.jones <tab> sally.jones@state.or.us I want to parse the data so that... (3 Replies)
Discussion started by: manouche
3 Replies

2. Shell Programming and Scripting

manipulate data with specific format

Hi everybody: I have a problem with how I have to manipulate the data which have specific format like this: 249. 0.30727021E+05 0.30601627E+05 0.37470780E-01 -0.44745335E+02 0.82674536E+03 248. 0.30428182E+05 0.30302787E+05 0.40564921E-01 -0.45210293E+02 ... (5 Replies)
Discussion started by: tonet
5 Replies

3. UNIX for Dummies Questions & Answers

Excel data manipulate

All, I have the following format of data in a spreadsheet A 1 2 3 4 B 1 2 3 4 where 'A' is value of 'A1', '1 2 3 4' is value of cell B1, 'B' is value of cell A2, and '1 2 3 4' is value of cell B2. There... (12 Replies)
Discussion started by: rahulrathod
12 Replies

4. Shell Programming and Scripting

Script to manipulate logfile text

Hi guys, I was wandering if a Shell guru could give me some advice on tackling a problem. I have used a mixture of grep, cut and awk to get data from a log file in the following format: 14/11/08 10:39: Checking currenly : Enabled 14/11/08 10:39: Records allocated : 221... (11 Replies)
Discussion started by: rosspaddock
11 Replies

5. Shell Programming and Scripting

how to manipulate with lines while playing with data

hello everyone, well I have a file which contains data, I want to add the data on hourly basis, like my file contains data for 24 hours, (so a total of 1440 ) lines. Now i want to add the data on hourly basis to get average values. like if I use (head) command it is ok for first go, but... (5 Replies)
Discussion started by: jojo123
5 Replies

6. Shell Programming and Scripting

Manipulate data in detail problem facing

Input Participant number: HAC Position type Location Distance_start Distance_end Range Mark 1 1 + Front 808 1083 276 2 1 + Front 1373 1636 264 3 1 - Back 1837 2047 211 Participant number: BCD Position type... (6 Replies)
Discussion started by: patrick87
6 Replies

7. Shell Programming and Scripting

Shell script to manipulate a file

Hello, I have a file with following contents : WSL SRVGRP=LISTENER SRVID=2 CLOPT="-A -t -- -n 0x0002aa050a03cc65 " RQPERM=0660 REPLYQ=Y RPPERM=0660 MIN=1 MAX=1 CONV=N I need to print only the value in Hex i.e.... (2 Replies)
Discussion started by: deo_kaustubh
2 Replies

8. Shell Programming and Scripting

Script to manipulate contents of clipboard

Hi there, I'm a total newbie and would like some help. I'd like to have a script to - load the contents of the clipboard into a variable - manipulate the variable by adding the characters /* to the beginning of every line and */ to the end of every line - load the variable back into the... (3 Replies)
Discussion started by: js8765
3 Replies

9. Shell Programming and Scripting

Extract & Manipulate continous data stream-- tcpdump

Hello; I have this rather tricky problem to solve --(to me, anyways) .. I am processing the following one liner with tcpdump.. tcpdump -i T3501 -A ether host 00:1e:49:29:fc:c9 or ether host 00:1b:2b:86:ec:1b or ether host 00:21:1c:98:a4:08 and net 149.83.6.0/24 | grep --line-buffered -B... (5 Replies)
Discussion started by: delphys
5 Replies

10. Shell Programming and Scripting

Help - manipulate data by columns and repeated

Hello good afternoon to everyone. I'm new to the forum and would like to request your help in handling data. I hope my English is clear. I have a file (Dato01.txt) to contine the following structure. # Col1 - Col2 - Col3 - Col4 Patricia started Jun 22 05:22:58 Carolina started Jun... (5 Replies)
Discussion started by: kelevra
5 Replies
NG_VLAN(4)						   BSD Kernel Interfaces Manual 						NG_VLAN(4)

NAME
ng_vlan -- IEEE 802.1Q VLAN tagging netgraph node type SYNOPSIS
#include <sys/types.h> #include <netgraph.h> #include <netgraph/ng_vlan.h> DESCRIPTION
The vlan node type multiplexes frames tagged according to the IEEE 802.1Q standard between different hooks. Each node has two special hooks, downstream and nomatch, and an arbitrary number of ``vlan'' hooks, each associated with a particular VLAN tag. An ETHERTYPE_VLAN frame received on the downstream hook with a tag that the node has been configured to filter is sent out the corresponding ``vlan'' hook. If it does not match any of the configured tags, or is not of a type ETHERTYPE_VLAN, it is sent out the nomatch hook. If the nomatch hook is not connected, the packet is dropped. An Ethernet frame received on the nomatch hook is passed unmodified to the downstream hook. An Ethernet frame received on any of the ``vlan'' hooks is tagged accordingly and sent out the downstream hook. HOOKS
This node type supports the following hooks: downstream Typically this hook would be connected to a ng_ether(4) node, using the lower hook. nomatch Typically this hook would also be connected to an ng_ether(4) type node using the upper hook. <any valid name> Any other hook name will be accepted and should later be associated with a particular tag. Typically this hook would be attached to an ng_eiface(4) type node using the ether hook. CONTROL MESSAGES
This node type supports the generic control messages, plus the following: NGM_VLAN_ADD_FILTER (addfilter) Associates a hook with the tag. NGM_VLAN_DEL_FILTER (delfilter) Disassociates a hook from the tag. NGM_VLAN_GET_TABLE (gettable) Returns a table of all hook/tag associations. EXAMPLES
#!/bin/sh ETHER_IF=rl0 ngctl -f- <<EOF shutdown ${ETHER_IF}: mkpeer ${ETHER_IF}: vlan lower downstream name ${ETHER_IF}:lower vlan connect ${ETHER_IF}: vlan: upper nomatch EOF ngctl mkpeer vlan: eiface vlan123 ether ngctl msg vlan: addfilter '{ vlan=123 hook="vlan123" }' SHUTDOWN
This node shuts down upon receipt of a NGM_SHUTDOWN control message, or when all hooks have been disconnected. SEE ALSO
netgraph(4), ng_eiface(4), ng_ether(4), ngctl(8), nghook(8) HISTORY
The ng_vlan node type appeared in FreeBSD 4.10. AUTHORS
Ruslan Ermilov <ru@FreeBSD.org> BSD
March 1, 2004 BSD
All times are GMT -4. The time now is 01:00 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy