my lines are like this:
I want this at output for each line:
I tried this:
as you see it returns this:
is there anyway to modify this with substr to get desired output?
Thanks
---------- Post updated at 07:51 PM ---------- Previous update was at 07:47 PM ----------
Sorry if this has been posted before, I searched but not sure what I really want to do.
I have a file with records that show who has logged into my application:
2003-03-14:I:root: Log_mesg: registered servername:userid. (more after this)
I want to pull out the userid, date and time into... (2 Replies)
Hi all,
I have a flatfile
I would like to get ext = 7950 , how do I do that ?
if ($1 == "CTI-ProgramStart") {
ext = substr($9,index($9,"Extension")+11,4);
But why it is not working ???? Please help .
Thanks (1 Reply)
i have a variable 200612
the last two digits of this variable should be between 1 and 12, it should not be greater than 12 or less than 1 (for ex: 00 or 13,14,15 is not accepted)
how do i check for this conditions in a unix shell script.
thanks
Ram (3 Replies)
Hi
I have multiple files that name begins bidb_yyyymm. (yyyymm = current year month of file creation).
What I want to do is look at the files and where yyyymm is older than 1 month I want to remove the file from the server.
I was looking at looping through the files and getting the yyyymm... (2 Replies)
I have a variable '$test' that has the following string value:
$test = 123|456|789|0123
How would I select just the first element ('123') using awk.
Note: '|' is the delimiter, and the length of each field can vary.
Thanks,
- CB (3 Replies)
I have the following to find lines matching "COMPLETE" and extract parts of it using substr.
sed -n "/COMPLETE/p" 1.txt | awk 'BEGIN { FS = "\" } {printf"%s %s:%s \n", substr($3,17,3),substr($6,4,1), substr($7,4,1)}' | sort | uniq > temp.txt
Worked fine until the numbers in 2nd & 3rd substr... (5 Replies)
HI I am using awk and substr function to list out the directory names in the present working directory .
I am using below code
ls -l | awk '{ if ((substr($1,1,1)) -eq d) {print $9 }}'
But the problem is i am getting all the files and directories listed where as the requirement i wrote... (7 Replies)
Hi to all,
I'm here again, cause I need your help to solve another issue for me.
I have some files that have this name format: date_filename.csv
In my shell I must rename each file removing the date so that the file name is filename.csv
To do this I use this command:
fnames=`ls ${fname}|... (2 Replies)
Hi,
- In a file test.wmi
Col1 | firstName | lastName
4003 | toto_titi_CT- | otot_itit
- I want to have only ( colones $7,$13 and $15) with code 4003 and 4002. for colone $13 I want to have the whole name untill _CT- or _GC-
1- I used the command egrep with awk
#egrep -i... (2 Replies)
Hello All;
I have an input file 'abc.txt' with below text:
512345977,213458,100021
512345978,213454,100031
512345979,213452,100051
512345980,213455,100061
512345981,213456,100071
512345982,213456,100091
512345983,213457,100041
512345984,213451,100011
I need to paste the first field... (10 Replies)
Discussion started by: mystition
10 Replies
LEARN ABOUT REDHAT
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).
Free Software Foundation Nov 3 1999 IGAWK(1)