Sponsored Content
Full Discussion: Extracting from file
Top Forums Shell Programming and Scripting Extracting from file Post 302115352 by hack_tom on Tuesday 24th of April 2007 05:39:56 AM
Old 04-24-2007
Extracting from file

Hi I have the file in following format

Begining of file
---------------------------------------
my name some dfgfgfk jdksjdkls laladsl sdlsdls
.
.
.
kfdjkfdk some drt pro vhdl sdjls.
----------------------------------------------------------------
ddr.spw.df.df 0 0 0 0 0
ddr.ser.ddf.tp 1 2 3 4 1
ddr.pwq.pro.fgt.tp 1 3 4 5 7
eth.pro.iw 1 2 3 4 5
eth.3po.lk 1 2 5 6 7
eth.3yu.lo 3 4 5 6 9

--------------------------------------------------------
end of file

Now I want to seprate all lines begining with ddr and sum their 5th column, similiarly I want to seprate all lines begining with eth and sum their 5th column. The top portion of file as shown might consist of some paragraph which I don't need to consider. So please can anyone help with perl script to perform this operation.

Thanks
 

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
AXNET_CS(4)						     Kernel Interfaces Manual						       AXNET_CS(4)

NAME
axnet_cs - Asix AX88190 chipset PCMCIA Ethernet Driver SYNOPSIS
insmod axnet_cs.o [pc_debug=n] [irq_list=i,j,...] DESCRIPTION
Axnet_cs is a driver for PCMCIA ethernet cards based on the Asix AX88190 chipset. These cards are mostly NE2000 compatible but have sev- eral bugs that are sufficiently tricky to work around that a separate driver was deemed necessary. When this driver is bound to a card, it allocates the next available ethernet device (eth0..eth#). This device name will be reported in the kernel log file, and passed on to cardmgr(8). PARAMETERS
pc_debug=n Selects the PCMCIA debugging level. This parameter is only available if the module is compiled with debugging enabled. A non-zero value enables debugging. irq_list=i,j,... Specifies the set of interrupts that may be allocated by this driver. DIAGNOSTICS
axnet_cs: this is not an AX88190 card! Indicates that this card is probably a normal NE2000 compatible card, which requires the pcnet_cs driver. eth#: interrupt(s) dropped! Indicates that the driver did not receive an interrupt notification for some reason. The driver will poll the card (with a signifi- cant performance penalty) if the problem persists. The most likely cause is an interrupt conflict and/or host bridge configuration problem. AUTHOR
David Hinds - dahinds@users.sourceforge.net SEE ALSO
cardmgr(8), pcmcia(5). pcmcia-cs 2001/08/17 12:51:58 AXNET_CS(4)
All times are GMT -4. The time now is 01:52 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy