Sponsored Content
Full Discussion: script help needed --- awk?
Top Forums Shell Programming and Scripting script help needed --- awk? Post 302207555 by scuderiaf1 on Friday 20th of June 2008 08:30:02 AM
Old 06-20-2008
zaxxon


Yes that is one of the things needed. I now under stand the -v and -E args of grep. ty.

I still need to consolidate a couple of fields on each record in between the '------' to one record...... does that make sense?

I have a base awk statement that i have started. I piped your recommended grep command to it.


Code:
grep -vE "^------|^$" $FILENAME | awk '$4="04" { print $1","$2 }'


Last edited by scuderiaf1; 06-21-2008 at 10:35 AM..
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Help with awk/shell script needed!

I have a shell script which reads a file named filelist.txt, containing a list of fully qualified filenames (with complete path), and then does some processing based on the file extension. In order to do the processing, I have to know the file extension, the filename without extension and just the... (3 Replies)
Discussion started by: inditopgun
3 Replies

2. Shell Programming and Scripting

Help needed in writing awk script for xml source

Hi, i am not able to get an approach for converting xml file to flat file using awk programming. Can anyone help me out. The input xml is like this: <outer> <field1>one</field1> <field2>two</field2> <field3>three<Error Code=777 Description=12345/></field3> <field4>four</field4> </outer>... (2 Replies)
Discussion started by: naren_0101bits
2 Replies

3. Shell Programming and Scripting

awk -help needed

hi, firstly, thank you all for helping me in previous posts. Here,I have a script with awk and a problem with in it as given below ********************************* parameter1=" $1" parameter2 = "$2" $script1 "parameter1" "parameter2" |\ { awk '{ ..... END{ ... (6 Replies)
Discussion started by: rider29
6 Replies

4. UNIX for Dummies Questions & Answers

Awk help needed..

I have to add number in column 1 by month. 1531 Feb 1 2007 pgaps_p007_27909.trc 1529 Feb 1 2007 pgaps_p006_27907.trc 1533 Feb 1 2007 pgaps_p005_27905.trc 635 Apr 7 2007 pgaps_smon_2347.trc 634 Apr 7 2007 pgaps_lgwr_2343.trc 634 Apr 8 2007 pgaps_lgwr_2311.trc 613 Apr 10 2007... (4 Replies)
Discussion started by: findprakash
4 Replies

5. Shell Programming and Scripting

awk help needed

How do I alter this command so that it prints only the second comma delimited field from line number 3? Secondly, how do you redirect the output to a variable called TEST? Thanks (cat BATCH007.TXT | awk 'BEGIN { FS = "," } ; {print $2 }') (5 Replies)
Discussion started by: ddurden7
5 Replies

6. Shell Programming and Scripting

Awk Help needed

hi, I have input file woth records as shown below OCSMRC_OK,7057348733,+0.00,0,18/05/2010 23:42:19,BellMobility,302610000918553,0006056099,B30,686505,686505,OCS_MRC,+49.14,0,0 ,0,0, OCSPPKB_NOK,4163460120,+1.25,0,18/05/2010... (4 Replies)
Discussion started by: raghavendra.cse
4 Replies

7. UNIX for Dummies Questions & Answers

Help Needed with AWK

I have a source file (sample below) that I'm trying to standarize into a text file with pipe delimited currently I'm looking at the file as space delimited.... :wall: I have one issue that I don't know how to handle - in the second set of " " is a filename along with the path - most cases that... (2 Replies)
Discussion started by: DebDor
2 Replies

8. Shell Programming and Scripting

awk help needed

Hi, i have input records as shown below. 4097,Probe3,G10,255,05/17/2011 12:44:03:185,NULL,05/17/2011 12:39:03:180,05/17/2011... (1 Reply)
Discussion started by: raghavendra.nsn
1 Replies

9. Shell Programming and Scripting

Simple awk script needed

but I'm stumped...please help I have a file like this....... 1000 1 34 1000 10 34 1000 11 35 1000 20 35 1000 21 36 1000 30 36 2000 1 34 2000 10 34 which I would like printed out as 40 lines 1000 1 34 1000 2 34 1000 3 34 1000 4 ... (2 Replies)
Discussion started by: garethsays
2 Replies

10. Shell Programming and Scripting

awk - help needed please

Hi.. have a file as below, appreciate if someone can help on this 143|500| 10| 23353 22131 23355 23354 23358 23352 23357 23350 23349 23351| RAID5 213|1008| 9| 22419 22412 221 22413 22414 22416 22417 22415 22418| RAID6 1088|500| 5| 22243 22240 22244 22242 22241| RAID5 322|1200| 12|... (6 Replies)
Discussion started by: richard0@rediff
6 Replies
IGAWK(1)							 Utility Commands							  IGAWK(1)

NAME
igawk - gawk with include files SYNOPSIS
igawk [ all gawk options ] -f program-file [ -- ] file ... igawk [ all gawk options ] [ -- ] program-text file ... DESCRIPTION
Igawk is a simple shell script that adds the ability to have ``include files'' to gawk(1). AWK programs for igawk are the same as for gawk, except that, in addition, you may have lines like @include getopt.awk in your program to include the file getopt.awk from either the current directory or one of the other directories in the search path. OPTIONS
See gawk(1) for a full description of the AWK language and the options that gawk supports. EXAMPLES
cat << EOF > test.awk @include getopt.awk BEGIN { while (getopt(ARGC, ARGV, "am:q") != -1) ... } EOF igawk -f test.awk SEE ALSO
gawk(1) Effective AWK Programming, Edition 1.0, published by the Free Software Foundation, 1995. AUTHOR
Arnold Robbins (arnold@skeeve.com). Free Software Foundation Nov 3 1999 IGAWK(1)
All times are GMT -4. The time now is 03:46 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy