Sponsored Content
Full Discussion: Processing files using awk
Top Forums Shell Programming and Scripting Processing files using awk Post 302453574 by danmero on Wednesday 15th of September 2010 07:19:29 PM
Old 09-15-2010
Code:
# awk '{split($NF,a,".");x=$6FS $7FS $8FS a[1];if(x!=y){print x,$5};y=x}' file
Sep 14 02:09 IMGBTREE27309_12272_11_1_0_FK 872
Sep 14 02:09 IMGBTREE27309_12272_11_0_0_PK 872
Sep 14 02:09 IMGBTREE27309_12272_11_0 432
Sep 15 13:24 PMLKUP11200_35_0_27813H64 8192
Sep 15 12:44 PMLKUP11200_35_0_27794H64 432
Sep 15 13:24 PMJNR11200_52_0_27813 432
Sep 15 12:44 PMJNR11200_52_0_27794 872

Please use [code] tags when you post code or sample data.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Preparing LaTeX files using Sed/AWK for processing with latex2html

As the title states, my issue involves preparing LaTeX documents for processing with latex2html. Within my LaTeX docs I have used a package which allows me to cleanly display source code listings. However the package is not supported by latex2html which, when processed, does not display the... (3 Replies)
Discussion started by: oski
3 Replies

2. Shell Programming and Scripting

awk processing

Hi all Is there a way in awk to know that you are processing your final line of input if you do no know how many lines were in the input to begin with? Thanks (7 Replies)
Discussion started by: pxy2d1
7 Replies

3. Shell Programming and Scripting

Writing output into different files while processing file using AWK

Hi, I am trying to do the following using AWK program. 1. Read the input data file 2. Parse the record and see if it contains errors 3. If the record contains errors, then write it into Reject file, else, write into usual output file or display it on the screen Here is what I have done -... (6 Replies)
Discussion started by: vidyak
6 Replies

4. UNIX for Dummies Questions & Answers

single output of awk script processing multiple files

Helllo UNIX Forum :) Since I am posting on this board, yes, I am new to UNIX! I read a copy of "UNIX made easy" from 1990, which felt like a making a "computer-science time jump" backwards ;) So, basically I have some sort of understanding what the basic concept is. Problem Description:... (6 Replies)
Discussion started by: Kasimir
6 Replies

5. Shell Programming and Scripting

get all files from a directory and pass the files for processing

Hi All, I have a directory in which there will be several files. i want to get all the files and pass it to a piece of code for processing on the files. This is the piece of code which does the processing. tr "\n" "|" < (log file name) | tr "$" "\n" > output echo ' ' >>output while... (1 Reply)
Discussion started by: suresh_kb211
1 Replies

6. Shell Programming and Scripting

awk script processing data from 2 files

Hi! I have 2 files containing data that I need to process at the same time, I have problems in reading a different number of lines from the different files. Here is an explanation of what I need to do (possibly with an awk script). File "samples.txt" contains data in the format: time_instant... (6 Replies)
Discussion started by: Alice236
6 Replies

7. Shell Programming and Scripting

processing with awk

I have many lines like the following in a file(there are also other kinds of lines) Host: 72.52.104.74 (tserv1.fmt2.he.net) Ports: 22/open/tcp//tcpwrapped///, 53/open/tcp//domain//PowerDNS 3.3/, 179/open/tcp//tcpwrapped/// Ignored State: closed (997) Seq Index: 207 IP ID Seq: All... (9 Replies)
Discussion started by: esolvepolito
9 Replies

8. Shell Programming and Scripting

Processing multiple files awk

hai i need my single awk script to act on 4 trace files of ns2 and to calculate througput and it should print result from each trace file in a single trace file. i tried with the following code but it doesnt work awk -f awkscript inputfile1 inputfile2 inputfile3 inputfile4>outputfile ... (4 Replies)
Discussion started by: sarathyy
4 Replies

9. Programming

awk processing / Shell Script Processing to remove columns text file

Hello, I extracted a list of files in a directory with the command ls . However this is not my computer, so the ls functionality has been revamped so that it gives the filesizes in front like this : This is the output of ls command : I stored the output in a file filelist 1.1M... (5 Replies)
Discussion started by: ajayram
5 Replies

10. Shell Programming and Scripting

Passing multiple files to awk for processing in bash script

Hi, I'm using awk command in bash script. I'm able to pass multiple files to awk for processing.The code i can use is as below(sample code) #!/bin/bash awk -F "," 'BEGIN { ... ... ... }' file1 file2 file3 In the above code i'm passing the file names manually and it is fine till my... (7 Replies)
Discussion started by: shree11
7 Replies
rpm2cpio(1)							   User Commands						       rpm2cpio(1)

NAME
       rpm2cpio - convert Red Hat Package (RPM) to cpio archive

SYNOPSIS
       rpm2cpio [file.rpm]

DESCRIPTION
       The  rpm2cpio  utility converts the .rpm file specified as its sole argument to a cpio archive on standard output. (See NOTES.) If no argu-
       ment is given, an rpm stream is read from standard input. In both cases, rpm2cpio will fail and print a usage message if the standard  out-
       put is a terminal. Therefore, the output is usually redirected to a file or piped through the cpio(1) utility.

EXAMPLES
       Example 1: Converting an rpm file

       example% rpm2cpio Device3Dfx-1.1-2.src.rpm | cpio -itv
       CPIO archive found!
       -rw-r--r--   1 root  root    2635 Sep 13 16:39 1998, 3dfx.gif
       -rw-r--r--   1 root  root   11339 Sep 27 16:03 1998, Dev3Dfx.tar.gz
       -rw-r--r--   1 root  root    1387 Sep 27 16:04 1998, Device3Dfx-1.1-2.spec
       31 blocks

       Example 2: Converting from standard input

       example% rpm2cpio < Device3Dfx-1.1-2.src.rpm | cpio -itv
       CPIO archive found!
       -rw-r--r--   1 root  root    2635 Sep 13 16:39 1998, 3dfx.gif
       -rw-r--r--   1 root  root   11339 Sep 27 16:03 1998, Dev3Dfx.tar.gz
       -rw-r--r--   1 root  root    1387 Sep 27 16:04 1998, Device3Dfx-1.1-2.spec
       31 blocks

ATTRIBUTES
       See attributes(5) for descriptions of the following attributes:

       +-----------------------------+-----------------------------+
       |      ATTRIBUTE TYPE	     |	    ATTRIBUTE VALUE	   |
       +-----------------------------+-----------------------------+
       |Availability		     |SUNWrpm			   |
       +-----------------------------+-----------------------------+

SEE ALSO
       cpio(1), attributes(5)

NOTES
       rpm2cpio handles versions 3 and 4 RPMs.

SunOS 5.10							    20 Aug 2001 						       rpm2cpio(1)
All times are GMT -4. The time now is 07:12 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy