Sponsored Content
Full Discussion: awk to find a formated o/p
Top Forums Shell Programming and Scripting awk to find a formated o/p Post 302248190 by radoulov on Friday 17th of October 2008 05:39:01 AM
Old 10-17-2008
Use nawk or /usr/xpg4/bin/awk on Solaris:

Code:
awk -F'\n' '$0="name: "$1OFS$3' RS= infile

Just noticed the last colon:

Code:
awk -F'\n' '{sub(/since /,":");print"name: "$1OFS$3}' RS= infile

 

10 More Discussions You Might Find Interesting

1. SuSE

Disk Formated with NTFS

HI All, My pc has two disks, One disk loaded with windows NT 2000 and redhat linux 7.2 dual boot. Another disk 80GB added and formated with NTFS file system. How to access the 80GB NTFS file system disk by booting linux os. Thanks in advance Bache Gowda (4 Replies)
Discussion started by: bache_gowda
4 Replies

2. Windows & DOS: Issues & Discussions

1.44mb disk formated = 1.38mb left??

I was formating a couple of floppy disks, to make room for a ftp install of suse. However, the files you are suposed to put on the floppys are 1.4 mb. I thought "Fine, I have a 1.44 mb disk here". But appearantly windows uses 600kb on....tmp files or something. If anyone knows how I might fix... (4 Replies)
Discussion started by: G-wizz
4 Replies

3. Shell Programming and Scripting

processing tab-formated output of command w/bash

I have a command that when ran it will have an output such as string LongerString string2 longerString2 More MoreStrings seperated by tabs. The command lists domains and their accounts set up in my server admin software (interworx). The end result will be that it will run rsync for... (2 Replies)
Discussion started by: sweede
2 Replies

4. Shell Programming and Scripting

Create a formated text file

Hi, I have written a BASH shell script (included below) which will allow me to monitor my blood pressure. The script computes the mean of 5 user input systolic, diastolic, and heart rate values. I would like the script to then append these three values to their respective columns in a text... (5 Replies)
Discussion started by: msb65
5 Replies

5. Shell Programming and Scripting

Find avg using awk

Hi, i need some help plz... The file data.txt contains: code of student,surname and name,code of lesson,grade of lesson.The number of lessons of each student is not the same. 25,Jackson Steve,12,4,34,2,65,2 29,Jordan Mary,13,6,23,8,56,4,34,2 04,Leven Kate,14,6,15,6,26,4 34,Owen... (10 Replies)
Discussion started by: Steve_09
10 Replies

6. Shell Programming and Scripting

Awk find and sel

Hi to all! I need to make an script to find when an user changes the IP. The log file have this simple structure; example.txt Jack 192.168.1.2 Tom 192.168.12.225 Mary 192.168.1.22 Jack 192.168.1.5 Patrick 192.168.1.88If match the same user in the first column and have differents IP in... (3 Replies)
Discussion started by: LordXeno
3 Replies

7. Shell Programming and Scripting

Using awk to find sentences.

I am trying to print out sentences that meets a regular expression in awk (I’m open to using other tools, too). I got the regular expression I want to use, "(\+ \{4\})" from user ripat in a grep forum. Unfortunately with grep I couldn't print only the sentence. While searching for awk... (8 Replies)
Discussion started by: danbroz
8 Replies

8. Filesystems, Disks and Memory

Recover a mistaken swap-formated USB-HD

Hi! Installing the debian wheezy by netinstall my external USB-HD (2TB) is erroneously completly formated as swap-filesystem. I was to lazy to disconnect the USB-HD, so now i could kick myself . Is there any chance to rescue the data. I tried to find a way by using gparted: the whole HD is... (3 Replies)
Discussion started by: IMPe
3 Replies

9. Shell Programming and Scripting

find percentage - awk

Please help me with this ... Input file /vol/test1 10G /vol/test2 1G /vol/test3 200G /vol/test4 3G Output File /vol/test1 10G - - 9G - /vol/test2 1024M - - 921M - /vol/test3 200G - - 180G - /vol/test4 3072M - - 2764M - Basically if Column 2 ( which is... (6 Replies)
Discussion started by: greycells
6 Replies

10. Shell Programming and Scripting

Find and replace in awk

I have a file that I am trying to find a specific word, then replace text within that string. file TestA2015 TestB2016 Example. Replace TestB2016 to TestB0000, so if TestB is found replace the original "2016" to "0000". Thank you :). awk tried awk '{ sub(/TestB$/, "0000", $6) }1'... (5 Replies)
Discussion started by: cmccabe
5 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 05:47 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy