Sponsored Content
Top Forums Shell Programming and Scripting Extracting field values from .csv Post 302845679 by leghorn on Thursday 22nd of August 2013 04:34:58 AM
Old 08-22-2013
Extracting field values from .csv

How can I select the bold fields from the following?
Code:
"CLLI","SWREL","RPTDATE","RPTIME","TZ","RPTTYPE","RPTPD","IVALDATE","IVALSTART","IVALEND","NUMENTIDS"
"tklc9010801","EAGLE5 45.0.0-64.70.1","2013-08-07","02:01:50","MST ","COMPONENT MEASUREMENTS ON LINK","LAST","2013-08-07","01:30:00","02:00:00",2800

"STATUS","LSN","LOC","LINK","LNKTYPE","MSGSTRAN","MSGSRCVD","MSURETRN","OCTRETRN","MOCTTRAN","MOCTRCVD","MTCEUSG","DURLKOTG","MSGSRGTT","MOCTRGTT","TDCNGLV1","TDCNGLV2","TDCNGLV3","ECCNGLV1","ECCNGLV2","ECCNGLV3","MSGDISC0","MSGDISC1","MSGDISC2","MSGDISC3","LNKAVAIL","NMGWSDSABL","OUTCELLS","INCCELLS","SDPDUTRN","SDPDURCV","SDPDURTR","LMSUTRN","LMSURCV","LMSUOCTTRN","LMSUOCTRCV","LMSUTRNDSC","LMSURCVDSC","M2PUDMTR","M2PUDOCT","M2PUDMRC","M2PUDOCR","M2PLKNIS","ECLNKCB","ECLNKXCO"
"K","ls1101i00","1201","A  ","IPVL",0,0,0,0,0,0,0,1800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
"K","ls1101n04","1201","B  ","IPVL",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1800,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0

please generalize it as the values can be different as well

~thanks

Last edited by vbe; 08-22-2013 at 05:41 AM..
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Need to compare two csv files values and write into another csv file

Hi all, Am new to scripting. So i just need your ideas to help me out. Here goes my requirement. I have two csv files 1.csv 2.csv abc,1.24 abc,1 def,2.13 def,1 I need to compare the first column of 1.csv with 2.csv and if matches then need to compare... (2 Replies)
Discussion started by: chinnahyd
2 Replies

2. Programming

Extracting Field values for XML file

i have an input file of XML type with data like <nx-charging:additional-parameter name="NX_INTERNATIONALIZED_CLID" value="919427960829"/><nx-charging:finalStatus>RESPONSE , Not/Applicable , OK</nx-charging:finalStatus></nx-charging:process> i want to extract data such that i get the output... (3 Replies)
Discussion started by: junaid.nehvi
3 Replies

3. Shell Programming and Scripting

Extracting a field value from a line

Used TNSNAMES adapter to resolve the alias Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 10.12.11.255)(PORT = 1540)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = CSMFIRE03))) I would like to extract the CSMFIRE03. I have no clue which command to use. Could... (5 Replies)
Discussion started by: Naresh Akkal
5 Replies

4. Shell Programming and Scripting

Find top N values for field X based on field Y's value

I want to find the top N entries for a certain field based on the values of another field. For example if N=3, we want the 3 best values for each entry: Entry1 ||| 100 Entry1 ||| 95 Entry1 ||| 30 Entry1 ||| 80 Entry1 ||| 50 Entry2 ||| 40 Entry2 ||| 20 Entry2 ||| 10 Entry2 ||| 50... (1 Reply)
Discussion started by: FrancoisCN
1 Replies

5. Shell Programming and Scripting

Need help with extracting field

hi there, i'm new to shell scripting as i usually just use our solaris server for db administration and to get some basic system information. however i'm stuck with something that requires further scripting knowledge. I need to extract the Name, Desc and Status from pkginfo-l. I need them... (10 Replies)
Discussion started by: sbavanis
10 Replies

6. Shell Programming and Scripting

adding field values if field matches

hi i have file as below , i want to add duplicate records like bell_bb to one record with valuve as 15 ( addition of both ) any oneline awk script to achive this ? header 0 CAMPAIGN_NAME 1 Bell_BB 14 Bell_MONTHLY 803 SOLO_UNBEATABLE 644 Bell_BB 1 Bell_MONTHLY 25 SOLO_UNBEATABLE... (4 Replies)
Discussion started by: raghavendra.cse
4 Replies

7. Shell Programming and Scripting

CSV with commas in field values, remove duplicates, cut columns

Hi Description of input file I have: ------------------------- 1) CSV with double quotes for string fields. 2) Some string fields have Comma as part of field value. 3) Have Duplicate lines 4) Have 200 columns/fields 5) File size is more than 10GB Description of output file I need:... (4 Replies)
Discussion started by: krishnix
4 Replies

8. Shell Programming and Scripting

Script for extracting data from csv file based on column values.

Hi all, I am new to shell script.I need your help to write a shell script. I need to write a shell script to extract data from a .csv file where columns are ',' separated. The file has 5 columns having values say column 1,column 2.....column 5 as below along with their valuesm.... (3 Replies)
Discussion started by: Vivekit82
3 Replies

9. Linux

How do I format a Date field of a .CSV file with multiple commas in a string field?

I have a .CSV file (file.csv) whose data are all enclosed in double quotes. Sample format of the file is as below: column1,column2,column3,column4,column5,column6, column7, Column8, Column9, Column10 "12","B000QRIGJ4","4432","string with quotes, and with a comma, and colon: in... (3 Replies)
Discussion started by: dhruuv369
3 Replies

10. Shell Programming and Scripting

Match columns from two csv files and update field in one of the csv file

Hi, I have a file of csv data, which looks like this: file1: 1AA,LGV_PONCEY_LES_ATHEE,1,\N,1,00020460E1,0,\N,\N,\N,\N,2,00.22335321,0.00466628 2BB,LES_POUGES_ASF,\N,200,200,00006298G1,0,\N,\N,\N,\N,1,00.30887539,0.00050312... (10 Replies)
Discussion started by: djoseph
10 Replies
NETWORKCTL(1)                                                       networkctl                                                       NETWORKCTL(1)

NAME
networkctl - Query the status of network links SYNOPSIS
networkctl [OPTIONS...] COMMAND [LINK...] DESCRIPTION
networkctl may be used to introspect the state of the network links as seen by systemd-networkd. Please refer to systemd- networkd.service(8) for an introduction to the basic concepts, functionality, and configuration syntax. OPTIONS
The following options are understood: -a --all Show all links with status. -h, --help Print a short help text and exit. --version Print a short version string and exit. --no-legend Do not print the legend, i.e. column headers and the footer with hints. --no-pager Do not pipe output into a pager. COMMANDS
The following commands are understood: list [LINK...] Show a list of existing links and their status. If no further arguments are specified shows all links, otherwise just the specified links. Produces output similar to: IDX LINK TYPE OPERATIONAL SETUP 1 lo loopback carrier unmanaged 2 eth0 ether routable configured 3 virbr0 ether no-carrier unmanaged 4 virbr0-nic ether off unmanaged 4 links listed. status [LINK...] Show information about the specified links: type, state, kernel module driver, hardware and IP address, configured DNS servers, etc. When no links are specified, an overall network status is shown. Also see the option --all. Produces output similar to: State: routable Address: 10.193.76.5 on eth0 192.168.122.1 on virbr0 169.254.190.105 on eth0 fe80::5054:aa:bbbb:cccc on eth0 Gateway: 10.193.11.1 (CISCO SYSTEMS, INC.) on eth0 DNS: 8.8.8.8 8.8.4.4 lldp [LINK...] Show discovered LLDP (Link Layer Discovery Protocol) neighbors. If one or more link names are specified only neighbors on those interfaces are shown. Otherwise shows discovered neighbors on all interfaces. Note that for this feature to work, LLDP= must be turned on on the specific interface, see systemd.network(5) for details. Produces output similar to: LINK CHASSIS ID SYSTEM NAME CAPS PORT ID PORT DESCRIPTION enp0s25 00:e0:4c:00:00:00 GS1900 ..b........ 2 Port #2 Capability Flags: o - Other; p - Repeater; b - Bridge; w - WLAN Access Point; r - Router; t - Telephone; d - DOCSIS cable device; a - Station; c - Customer VLAN; s - Service VLAN, m - Two-port MAC Relay (TPMR) 1 neighbors listed. label Show numerical address labels that can be used for address selection. This is the same information that ip-addrlabel(8) shows. See RFC 3484[1] for a discussion of address labels. Produces output similar to: Prefix/Prefixlen Label ::/0 1 fc00::/7 5 fec0::/10 11 2002::/16 2 3ffe::/16 12 2001:10::/28 7 2001::/32 6 ::ffff:0.0.0.0/96 4 ::/96 3 ::1/128 0 EXIT STATUS
On success, 0 is returned, a non-zero failure code otherwise. SEE ALSO
systemd-networkd.service(8), systemd.network(5), systemd.netdev(5), ip(8) NOTES
1. RFC 3484 https://tools.ietf.org/html/rfc3484 systemd 237 NETWORKCTL(1)
All times are GMT -4. The time now is 04:01 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy