Sponsored Content
Full Discussion: Extracting from file
Top Forums Shell Programming and Scripting Extracting from file Post 302115370 by ghostdog74 on Tuesday 24th of April 2007 07:22:45 AM
Old 04-24-2007
Code:
awk 'BEGIN{}
	/^ddr/ { ddr += $5}
	/^eth/ { eth+=$5 }
END {
     print "ddr count is " ddr
     print "eth count is " eth
     } ' "file"

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Extracting IP's from a file

I've been trying to work out a way to extract IP's from a file. The IP's are contained withing brackets like this: is there a way to extract just the IP's or at least everything from the starting to ending bracket with grep or something similar? Thanks in advance. (14 Replies)
Discussion started by: eth0
14 Replies

2. Shell Programming and Scripting

[Splitting file] Extracting group of segments from one file to others

Hi there, I need to split one huge file into separate files if the condition is fulfilled according to that the position between 97 and 98 matches with “IT” at the segment MAS. There is no delimiter file is fix-width with varous line length. Could you please help me how I do split the file... (1 Reply)
Discussion started by: ozgurgul
1 Replies

3. Shell Programming and Scripting

Extracting data from text file based on configuration set in config file

Hi , a:) i have configuration file with pattren <Range start no>,<Range end no>,<type of records to be extracted from the data file>,<name of the file to store output> eg: myfile.confg 9899000000,9899999999,DATA,b.dat 9899000000,9899999999,SMS,a.dat b:) Stucture of my data file is... (3 Replies)
Discussion started by: suparnbector
3 Replies

4. Shell Programming and Scripting

Parsing file, yaml file? Extracting specific sections

Here is a data file, which I believe is in YAML. I am trying to retrieve just the 'addon_domains" section, which doesnt seem to be as easy as I had originally thought. Any help on this would be greatly appreciated!! I have been trying to do this in awk and mostly bash scripting instead of perl... (3 Replies)
Discussion started by: Rhije
3 Replies

5. Shell Programming and Scripting

extracting columns using pattern file from source file

Hi experts,Please help me for the below requirement. i have a source file.(lets say contains 50 columns). I am extarcting five columns from the source file by using pattern file. for example input file:--------a,b,c,d,"a,g","v b",s,koutputfile=======a,"a,g","v b",s,kThanks in advance subhendu (2 Replies)
Discussion started by: subhendu81
2 Replies

6. Shell Programming and Scripting

Extracting a column from a file and merging with other file using awk

Hi All: I have following files: File 1: <header> text... text .. text .. text .. <\header> x y z ... File 2: <header> text... text .. text .. (4 Replies)
Discussion started by: mrn006
4 Replies

7. Shell Programming and Scripting

extracting line numbers from a file and redirecting them to another file

i have applied the following command on a file named unix.txt that contains the string "linux from the text" grep -n -i -w "linux from the text" unix.txt and the result is 5:Today's Linux from the text systems are split into various branches, developed over time by AT&T as well as various... (5 Replies)
Discussion started by: arindamlive
5 Replies

8. Shell Programming and Scripting

reading a file extracting information writing to a file

Hi I am trying to extract information out of a file but keep getting grep cant open errors the code is below: #bash #extract orders with blank address details # # obtain the current date # set today to the current date ccyymmdd format today=`date +%c%m%d | cut -c24-31` echo... (8 Replies)
Discussion started by: Bruble
8 Replies

9. UNIX for Dummies Questions & Answers

Extracting line1 from a file with certain file pattern in line 7

Hello there, I am new to unix and would like to do the following, hoping someone would give some guide, thanks in advance. Lets say i have a file like this: A w x y w x 0.1 B w x y w x 0.3 C w x y w x 0.7 D w x y w x 0.9 E w x y w x 0.2 So i would like to extract line 1 data where line... (2 Replies)
Discussion started by: seiksoon
2 Replies

10. UNIX for Dummies Questions & Answers

Extracting data from one file, based on another file (splitting)

Dear All, I have two files but want to extract data from one based on another... can you please help me file 1 David Tom Ellen and file 2 David|0010|testnamez|resultsz David|0004|testnamex|resultsx Tom|0010|testnamez|resultsz Tom|0004|testnamex|resultsx Ellen|0010|testnamez|resultsz... (12 Replies)
Discussion started by: A-V
12 Replies
MII-TOOL(8)						      System Manager's Manual						       MII-TOOL(8)

NAME
mii-tool - view, manipulate media-independent interface status SYNOPSIS
mii-tool [-v, --verbose] [-V, --version] [-R, --reset] [-r, --restart] [-w, --watch] [-l, --log] [-A, --advertise=media,...] [-F, --force=media] [interface ...] DESCRIPTION
This utility checks or sets the status of a network interface's Media Independent Interface (MII) unit. Most fast ethernet adapters use an MII to autonegotiate link speed and duplex setting. Most intelligent network devices use an autonegotiation protocol to communicate what media technologies they support, and then select the fastest mutually supported media technology. The -A or --advertise options can be used to tell the MII to only advertise a subset of its capabilities. Some passive devices, such as single-speed hubs, are unable to autonegotiate. To handle such devices, the MII protocol also allows for establishing a link by simply detecting either a 10baseT or 100baseT link beat. The -F or --force options can be used to force the MII to operate in one mode, instead of autonegotiating. The -A and -F options are mutually exclusive. The default short output reports the negotiated link speed and link status for each interface. If an interface or interfaces are not spec- ified on the command line, then mii-tool will check any available interfaces from eth0 through eth7. OPTIONS
-v, --verbose Display more detailed MII status information. If used twice, also display raw MII register contents. -V, --version Display program version information. -R, --reset Reset the MII to its default configuration. -r, --restart Restart autonegotiation. -w, --watch Watch interface(s) and report changes in link status. The MII interfaces are polled at one second intervals. -l, --log Used with -w, records link status changes in the system log instead of printing on standard output. -F media, --force=media Disable autonegotiation, and force the MII to either 100baseTx-FD, 100baseTx-HD, 10baseT-FD, or 10baseT-HD operation. -A media,..., --advertise=media,... Enable and restart autonegotiation, and advertise only the specified media technologies. Multiple technologies should be separated by commas. Valid media are 100baseT4, 100baseTx-FD, 100baseTx-HD, 10baseT-FD, and 10baseT-HD. DIAGNOSTICS
SIOCGMIIPHY on 'eth?' failed: Invalid argument If the interface is not running (up), kernel will refuse to report its link state. SIOCGMIIPHY on 'eth?' failed: Operation not permitted Most kernels restrict access to root. SIOCGMIIPHY on 'eth?' failed: No such device This error is shown, if the kernel does not know about the named device. SIOCGMIIPHY on 'eth?' failed: Operation not supported The interface in question does not support MII queries. Most likely, it does not have MII transceivers, at all. AUTHORS
David Hinds - dhinds@pcmcia.sourceforge.org Donald Becker - becker@scyld.com Bernd Eckenfels - ecki@debian.org net-tools 2004/03/28 23:30:00 MII-TOOL(8)
All times are GMT -4. The time now is 01:24 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy