Sponsored Content
Top Forums Shell Programming and Scripting 2 problems: Mailing CSV file / parsing CSV for display Post 302379028 by soldstatic on Wednesday 9th of December 2009 09:57:36 AM
Old 12-09-2009
OK my biggest problem is that I want to be able to use this on a number of different queries, and most of my queries / CSV have 10-25 columns, and I'm not about to write out in scripts for each and every column depending on the particular query. I want to write this in a nice easy function.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Help in parsing a CSV file with Shell script

I have a CSV file which contains number series as one of the fields. Some of the records of the field look like : 079661/3 I have to convert the above series as 079661 079662 079663 and store it as 3 different records. Looking for help on how to achieve this. Am a newbie at Shell... (10 Replies)
Discussion started by: mihirk
10 Replies

2. Shell Programming and Scripting

Parsing a csv file

I am trying to parse a csv file in the below 'name-value pair' format and then use the values corresponding to the name. Type:G,Instance:instance1,FunctionalID:funcid,Env:dev,AppName:appname... (6 Replies)
Discussion started by: chiru_h
6 Replies

3. Shell Programming and Scripting

CSV file parsing and validation

I have a CSV file that needs to through two seperate processes (in the end there will be 2 files (Dload.unl and Tload.unl and we'll say the input file name is mass.csv). I have a processfile() function that will call the process Dload funtion. In Dload I want to read mass.csv into Dload and then... (1 Reply)
Discussion started by: dolo21taf
1 Replies

4. Shell Programming and Scripting

Parsing a CSV File

Hey guys, I'm in the process of learning PHP and BASH scripting. I'm getting there, slowly ;) I would like some help with parsing a CSV file. This file contains a list of hostnames, dates, and either Valid, Expired, or Expired Soon in the last column. Basically, I want to parse the file,... (12 Replies)
Discussion started by: dzl
12 Replies

5. Shell Programming and Scripting

Parsing complicated CSV file with sed

Yes, there is a great doc out there that discusses parsing csv files with sed, and this topic has been covered before but not enough to answer my question (unix.com forums). I'm trying to parse a CSV file that has optional quotes like the following: "Apple","Apples, are fun",3.60,4.4,"I... (3 Replies)
Discussion started by: analog999
3 Replies

6. Shell Programming and Scripting

Parsing a CSV file and deleting all rows on condition

Hello list, I am working on a csv file which contains two fields per record which contain IP addresses. What I am trying to do is find records which have identical fields(IP addresses) which occur 4(four) times, and if they do, delete all records with that specific identical field(ip address). ... (4 Replies)
Discussion started by: landossa
4 Replies

7. Shell Programming and Scripting

Help required in parsing a csv file

Hi Members, I am stuck with the following problem. Request your kind help I have an csv file which contains, 1 header record, data records and 1 footer record. Sample is as below Contents of cm_update_file_101010.csv -------------------------------------------------- ... (6 Replies)
Discussion started by: ramakanth_burra
6 Replies

8. Shell Programming and Scripting

Parsing csv file and pass to a variable

Hi, Newbie here and I need some help to parse a csv file that contains fields separated by ",". What I need to achieve here is, read the 1 line file and extract 240 fields and pass to a variable and then read the next 240 fields and pass to a variable, over and over. If anyone can assist that... (4 Replies)
Discussion started by: tmslixx
4 Replies

9. Shell Programming and Scripting

Csv file parsing and validating

Hi, I have basic knowledge on unix shell scripting(not an expert). My requirement is reading the csv file using the schema defined in the configuration file and if the condition is not mached then move the unmatched record to a error file and matched good records into other file. In brief: ... (43 Replies)
Discussion started by: shree11
43 Replies

10. Shell Programming and Scripting

Help with Parsing a CSV File

Hello All, I have an input CSV file like below, where first row data can be in different position after every run of the tool, i.e. pzTest in below example is in column 1, but it can be also in 3 column and same for all the headers in the first row. pzTest, pzExtract, pxUpdate, pzInfo... (1 Reply)
Discussion started by: asirohi
1 Replies
named.stats(4)						     Kernel Interfaces Manual						    named.stats(4)

NAME
named.stats - Contains BIND server statistics DESCRIPTION
The named.stats file contains server statistics for queries to and from hosts in a BIND environment. You can use this data to determine the load on a DNS server and diagnose problems. See the named(8) reference page for information about how to specify the name and location of the named.stats file; the default is /var/tmp/named.stats. The query fields for global and per-node statistics, as specified in the LEGEND section of the named.stats file, are defined as follows: Received a response from a node Received a negative response from a node Received a response from a node that this node had to forward Received an extra answer from a node Received a server failed message (SERVFAIL) from a node Received a format error message (FORMERR) from a node Received some other error from a node Received an zone transfer request mes- sage (AXFR) from a node Received a lame delegation from a node Received some IP options from a node Sent a node a system query Sent a node an answer Forwarded a query to a node Sent a node a retry Sent to a node, but the send failed (in sendto) Received a query from a node Received an inverse query from a node Received a query from a node that this node had to forward Received a retry from a node Received a query using TCP from a node Forwarded a response to a node Sent a node a server failed message (SERVFAIL) Sent a node a format error message (FORMERR) Sent a non-authoritative answer to a node Sent a negative response to a node EXAMPLES
The following example is an excerpt of a named.stats file: +++ Statistics Dump +++ (917839766) Sun Jan 31 22:29:26 1999 370508 time since boot (secs) 370508 time since reset (secs) 130 Unknown query types 711033 A queries 35 NS queries 37 CNAME queries 40 SOA queries 2 MB queries 198963 PTR queries 26088 MX queries 1 TXT queries 20 AAAA queries 60910 ANY queries ++ Name Server Statistics ++ (Legend) RR RNXD RFwdR RDupR RFail RFErr RErr RAXFR RLame ROpts SSysQ SAns SFwdQ SDupQ SErr RQ RIQ RFwdQ RDupQ RTCP SFwdR SFail SFErr SNaAns SNXD (Global) 537 231 479 0 2 10 0 0 5 0 54 56382 479 8 2 38849 3 0 0 6 479 2 5 19057 1285 [0.0.0.0] 0 0 2 0 0 0 0 0 0 0 0 0 0 4 0 0 0 0 0 0 23 1 0 0 0 [4.0.38.18] 0 0 0 0 0 0 0 0 0 0 0 2 0 0 0 2 0 0 0 0 0 0 0 0 0 [4.0.147.94] 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 1 0 0 0 0 0 0 0 0 0 . . . The values in each entry below the (Global) delimeter are separated into five groups, each with five numbers. These groups of numbers cor- relate to the fields in the Legend section of the file, which are separated into similar groups. From the left of an entry, the first field is RR, the next is RNXD, and so on. In the next group of five on the same line, the first field is RFErr, the next is RErr, and so on. In the Global entry, you can see that, in total, there were 537 queries received, 231 negatives responses received, 479 queries that were forwarded to other BIND servers, and so on. Subsequent entries can be interpreted in a similar manner. The Global values in this example are indicative of several problems: RFail = 2 The server received 2 failure messages from a node or nodes. There might be a problem with the nodes that attempted to query the server. Find the IP addresses of the nodes and contact the administrators. RFErr = 10 The server received 10 improperly formatted queries from a node or nodes. If this happens consistently, a hacker might be trying to break into the server. You should run a monitoring tool to collect more data. RLame = 5 The server received 5 lame delegations. This problem occurs if nodes query the server for information regarding a zone for which it has no authority. It is usually a temporary condition, but if the problem persists, contact the nodes' administrators and ask them to check their configurations. RDupR = 8 A node or nodes sent multiple copies of the same query to the server. These errors are usually benign, but nodes should give up after 3 attempts. If the number of duplicates is fairly high, there might be a problem with the nodes or the network. SErr = 2 The server attempted to send 2 queries to a forwarder or forwarders by using the sendto system call, and the attempts failed. Check your configuration and make sure that all of the forwarders you listed are reachable. RIQ = 3 The server received 3 inverse queries. These queries are usually benign, but if the value is fairly high, a hacker might be trying to break into the server. You should run a monitoring tool to collect more data. SFail = 2 The server sent 2 failure messages to a node or nodes. These failures are usually benign, but might not be under certain condi- tions. If the server sends many SFail errors to one node, there might be a problem with that node. If the node is another name- server, it might be lame nameserver. If the node is a host, it is sending abnormal queries. You should find the offending node and resolve the problem. SFerr = 5 The server informed a node or nodes that their requests were improperly formatted. The value of this field usually correlates to the RFErr field. You should find the offending node and resolve the problem. FILES
The syslogd daemon offers a partial listing of the named.stats data in the daemon.log file. RELATED INFORMATION
Commands: named(8), syslogd(8) delim off named.stats(4)
All times are GMT -4. The time now is 03:26 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy