Sponsored Content
Top Forums UNIX for Dummies Questions & Answers awk help: how to pull phrase and one column from line above? Post 302857959 by Scottie1954 on Friday 27th of September 2013 05:23:36 PM
Old 09-27-2013
Yes! That's it. Unfortunately, the column value I want isn't always the $3 field when the name has a middle initial. James T Kirk, for example, puts the value I want in $5.

Thank you!
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

line to column using awk

hi, i'm a newbie and this is my first post here. 'hope all of you fellow members are doing fine. so here is my first thread to ask for help on how to use awk language to do this task. i have a file to process and after a series of other awk commands and shell scripts i managed to convert the... (11 Replies)
Discussion started by: genix2008
11 Replies

2. Shell Programming and Scripting

awk convert from line to column

i have an output like this : 012008 25760883 022008 12273095 032007 10103 032008 10115642 042007 20952798 but i would like to have it like this 012008,25760883 022008,12273095 032007,10103 032008,10115642 042007,20952798 (4 Replies)
Discussion started by: jarmouda
4 Replies

3. Shell Programming and Scripting

Extracting line matching a phrase and then the next lines after it

Hi all, I was wondering if someone could tell me a way to extract from a file lines where you search for a phrase and then also extract the next X lines after it (i.e. take a block of text from the file)? Example { id=123 time=10:00:00 date=12/12/09 { ........ ... (6 Replies)
Discussion started by: muay_tb
6 Replies

4. Shell Programming and Scripting

awk : Remove column1 and last column in a line

Hi All, How to remove col1 and last column in a line. Please suggest some awk stuffs. Input col1 col2 col3 col4 col1 col2 col3 col4 col5 col1 col2 col3 col4 col1 col2 col3 Output Processing col2 col3 ... Processing col2 col3 col4 ... Processing col2 col3 ... Processing... (5 Replies)
Discussion started by: k_manimuthu
5 Replies

5. Shell Programming and Scripting

Counting rows line by line from a specific column using Awk

Dear UNIX community, I would like to to count characters from a specific row and have them displayed line-by-line. I have a file called testAwk2.csv which contain the following data: rabbit penguin goat giraffe emu ostrich I would like to count in the middle row individually... (4 Replies)
Discussion started by: vnayak
4 Replies

6. Shell Programming and Scripting

simple sed question - replace from phrase to end of line

I have the following line an in input file I want to digest with sed and simple replace the bold part with a variable defined in my bash script. I can do this in several sed operations but I know there must be a way to do it in a single sed line. What is the syntax? Line in file:... (1 Reply)
Discussion started by: graysky
1 Replies

7. Shell Programming and Scripting

Awk next line as column

Hi, This forum rocks. I think this might be an easy thing, but since I am new to awk, please help me. input: x y z 1 a b c 2 d e f 3 g h i 7 output: x y z 1 a b c 2 d e f 3 (8 Replies)
Discussion started by: jacobs.smith
8 Replies

8. UNIX for Dummies Questions & Answers

How to match on phrase at beginning of line and specific columns?

Here is my file: 700 7912345678910 61234567891234567891 700 8012345678910 61234567891234567891 I want to pull all lines that begin with '700' only if columns 11-12 are '79'. My code so far only pulls the '79', not the whole line: grep ^700 file1 | cut -c 11,12 |... (7 Replies)
Discussion started by: Scottie1954
7 Replies

9. Shell Programming and Scripting

How to find a phrase and pull all lines that follow until the phrase occurs again?

I want to burst a report by using the page number value in the report header. Each section starts with *PAGE NO:* 1 Each section might have several pages, but the next section always starts back at 1. So I want to find the "*PAGE NO:* 1" value and pull all lines that follow until "*PAGE NO:* 1"... (4 Replies)
Discussion started by: Scottie1954
4 Replies

10. Shell Programming and Scripting

Phrase txt file row to column

Hi Guys, I have one Big txt file and i what to phrase specific part as below. Input :- Event Event { recordLength 160118, recordType 411, eventId 3102118, INTERNAL_PER_RO_ME_TA { EVVXX_TIMESTAMP_HOUR 16, EVVXX_TIMESTAMP_MINUTE 15, EVVXX_TIMESTAMP_SECOND 3, ... (6 Replies)
Discussion started by: pareshkp
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 07:49 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy