Sponsored Content
Top Forums Shell Programming and Scripting Cant see rest of the output of the file using awk Post 302736567 by Jared on Tuesday 27th of November 2012 01:51:01 PM
Old 11-27-2012
Cant see rest of the output of the file using awk

I am trying to parse through set of data from large txt file and only intersted in output below . i am using below awk command to get the output but it only shows first line , i need to see the rest of the output under hardware inventory. see below

Code:
]$ awk '{ if ( $0 ~ "^Hardware inventory" ) { print; getline tmp; print tmp } } ' wor3e01_result.txt 
Hardware inventory:
Item             Version  Part number  Serial number     Description
Hardware inventory:
Item             Version  Part number  CLEI code         FRU model number

thanks in advance!
jared

Last edited by Franklin52; 11-29-2012 at 03:48 AM.. Reason: Please use code tags for data and code samples
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Want to execute rest of the script after the file is ready ...

Hi All I have a requirement like, where a file gets generated in a particular dir and once the file is ready and available then I want to execute rest of the script, because untill and unless the file exists and is available there is no use of running rest of the commands in that script. ... (5 Replies)
Discussion started by: csaha
5 Replies

2. Shell Programming and Scripting

Awk adding a space between integer and the rest of the field

Hi, I have a problem where some of the records I need to process have the first address field as something like "10Walpole Street" where obviously I want it to be "10 Walpole Street". I know I need to somehow separate out the integer and probably form a new string variable, but I just don't... (5 Replies)
Discussion started by: jonathanm
5 Replies

3. Shell Programming and Scripting

Parse file using awk and work in awk output

hi guys, i want to parse a file using public function, the file contain raw data in the below format i want to get the output like this to load it to Oracle DB MARWA1,BSS:26,1,3,0,0,0,0,0.00,22,22,22.00 MARWA2,BSS:26,1,3,0,0,0,0,0.00,22,22,22.00 this the file raw format: Number of... (6 Replies)
Discussion started by: dagigg
6 Replies

4. Shell Programming and Scripting

Cut last 13 characters and take the rest of the file name

Hi, I would like to cut last 13 characters of a file name and take the rename the file name as follows: Input: A.DAT20110517033732 Output: A.DAT I have tried the following command and cut last 13 characters. echo A.DAT20110517033732 | awk '{print substr($0, length($0)-13)}' ... (3 Replies)
Discussion started by: pyaranoid
3 Replies

5. Shell Programming and Scripting

awk delete/remove rest of line on multiple search pattern

Need to remove rest of line after the equals sign on search pattern from the searchfile. Can anybody help. Couldn't find any similar example in the forum: infile: 64_1535: Delm. = 86 var, aaga 64_1535: Fran. = 57 ex. ccc 64_1639: Feb. = 26 (link). def 64_1817: mar. = 3/4. drz ... (7 Replies)
Discussion started by: sdf
7 Replies

6. UNIX for Dummies Questions & Answers

find string and get the rest of the line in a pipe delimited file

Hi friends, I have a file where I should search for a string and get the rest of the line but without the delimiter using awk. for example I have the series of string in a file: input_string.txt bbb ccc aaa and the mapping file looks like this. mapping.txt aaa|12 bbb|23 ccc|43... (11 Replies)
Discussion started by: kokoro
11 Replies

7. Shell Programming and Scripting

Find the text in the file and delete the rest of the line.

Hi, I have one requiremnet like this. I need to find some particular string (eg.IncludeDateTime = ) in a file. And wherever it finds the string the unix script has to delete the remaining text coming after the string (ie., 'IncludeDateTime = ' ) in the same line. I tried to write this script in... (5 Replies)
Discussion started by: jannusuresh
5 Replies

8. Shell Programming and Scripting

[Solved] How to display only output of DBMS_OUTPUT.PUT_LINE , rest should be neglected

Hi All, I Have written a script through that i am calling sql file Sqlfile.sql set time on set timing on set echo on set head off set scan on set feedback on set serveroutput on set linesize 1000 DECLARE v_acc_no NUMBER(10); v_product_no NUMBER(10); BEGIN... (3 Replies)
Discussion started by: sujit_kashyap
3 Replies

9. Shell Programming and Scripting

Awk script to run a sql and print the output to an output file

Hi All, I have around 900 Select Sql's which I would like to run in an awk script and print the output of those sql's in an txt file. Can you anyone pls let me know how do I do it and execute the awk script? Thanks. (4 Replies)
Discussion started by: adept
4 Replies

10. Shell Programming and Scripting

awk to reformat output if input file is empty, but not if file has data in it

The below awk improved bu @MadeInGermany, works great as long as the input file has data in it in the below format: input chrX 25031028 25031925 chrX:25031028-25031925 ARX 631 18 chrX 25031028 25031925 chrX:25031028-25031925 ARX 632 14... (3 Replies)
Discussion started by: cmccabe
3 Replies
stl_inv(4)						     Kernel Interfaces Manual							stl_inv(4)

NAME
stl_inv - setld inventory file format DESCRIPTION
Each software product that is distributed as subsets for the setld(8) command has an associated inventory file. This inventory file is created by the kits(1) utility. The inventory file's name consists of the product's unique 3-letter name with the string .inv for a suf- fix. The inventory file contains one record for each subset in the kit. Each record contains the following twelve fields in order, sepa- rated by TAB characters: Flags The per-file software management flag, a 16-bit unsigned integer Size The actual number of bytes in the file Checksum The modulo-65536 checksum of the file. Hard links, directories, FIFOs, and sockets have 00000 in this field. uid The user ID of the file's owner gid The group ID of the file's owner Mode The 6-digit octal representation of the file's mode Date The file's last modification date Revision The version code of the product that includes the file Type A letter that describes the file: b Block device c Character device d Directory containing one or more files f Regular file. For regular files with a link count greater than one, see file type l. l Hard link. There are other files in the same inventory which have the same inum. The first of these files in ASCII collating sequence is listed in the referent field. p Named pipe (FIFO) s Symbolic link = UNIX domain socket Pathname The dot-relative (./) pathname of the file Link-to For file types l and s, the path to which the file is linked; for types b and c, an integer representing the major and minor num- bers of the device; for all other types, none Subset name The name of the subset containing the file RESTRICTIONS
Fields must be separated by TAB characters. RELATED INFORMATION
Commands: setld(8) Functions: stat(2) Documents: Guide to Preparing Product Kits delim off stl_inv(4)
All times are GMT -4. The time now is 01:59 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy