Since the field being changed is being set to a non-zero numeric string (and also works if it is being set to a non-empty, non-numeric string), the simplest way to do it is:
I would like to parse a file and use each record to create a unique file
where the name of the file created is taken from the 3rd field.
Example: here are 3 records.
000007 0110 07-0001583 20060802132213 20060801112601
000007 0110 07-0001584 ... (4 Replies)
Hi there.
I've got 12 years experience writing C++ on Windows, and 3 years C# on Windows. Now my boss wants me to write a C++ app to run on Unix as a multithreaded 'service' (i.e. a program that runs with no user intervention).
Some quick questions for The Experts:
* Whats the best C++... (3 Replies)
Hello all
I have a file with below data, I need to add a third column as XXXX if the first coloumn (H180620081) last number is "1"
and YYYY if the first coloumn last number is "2"
Can it be done with AWK, I would appreciate if anyone could help me ou with this.
H180620081 31310 ... (11 Replies)
Hi all,
I have an awk basic question.
file.text
Our Location:
Our home has light yellow siding,
and is a duplex on Main Street,
across from the High School,
and across the lane from the Health Center
If I run:
cat file.txt | awk '{print $2}' | grep... (7 Replies)
I have a script problem that I am not able to solve due my very limited understanding of unix/awk.
This is the contents of test.sh
awk '{print $1}'
From the prompt if I enter:
./test.sh Hello World
I would expect to see "Hello" but all I get is a blank line. Only then if I enter "Hello... (2 Replies)
Hi there, greetingt to everybody.
I have configured syslog-ng to get messages over UDP saving logs into a text file, it works fine.
I need to store the content of this file in several files depending from some criteria that I try to explain you with some examples :
Suppose the content of my log... (5 Replies)
Hey guys I searched for this for the past few hours but maybe I dont know what the heck I am searching for.
I am looking how to locate my .profile and where the heck I can find it to be able to edit it.
Thanks in advance. (11 Replies)
what is a assembler
what isa interpreter
what is a compiler
what is a socket
what is a port
what is meant by listening to a port how we do it
how to know version and standard of unix one is using when one is on public access unix account
how to see a jobid in... (1 Reply)
I find an script with awk sitting around. I went through some online manuals, but I can't figure out exactly how it works. I can't post the whole program. Not allowed.
This is the line that is confusing me. I get when else is in the script
grep -v "^REM " $1| grep -v "JUNK;" | awk -F" "... (2 Replies)
Im sure this is an easy question, but Ive tried and tried to get this to print all on one line and cant figure out why its not, so maybe someone can help
awk '/AP/{sub(/:80/, "", $4);printf $4"\t"} /User-Agent/{sub(/^*:/,"");print};sub(/\.80/,"", $4);/Host/{sub(/^*:/,""); print}'
What this... (10 Replies)
Discussion started by: sectech
10 Replies
LEARN ABOUT OPENSOLARIS
igawk
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).
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+--------------------+-----------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+--------------------+-----------------+
|Availability | SUNWgawk |
+--------------------+-----------------+
|Interface Stability | Volatile |
+--------------------+-----------------+
NOTES
Source for gawk is available on http://opensolaris.org.
Free Software Foundation Nov 3 1999 IGAWK(1)