09-26-2006
Extract data correction???
Hi
I have file "test.txt"
i need to extract the data as below from this file.
/home/cvs/gkc ->awk -v RS= '{print $(NF-2),$(NF-1),$NF}' test.txt
Buildfile: build.xml Buildfile: build.xml
Created dir: /dist/advance/2.0.4/20060926-0413
awk: The field -1 must be in the range 0 to 199.
The input line number is 3. The file is test.txt.
The source line number is 1.
I am getting all of the above errors i need only the following /dist/advance/2.0.4/20060926-0413 from that file without any spaces.
so that i will be using this data in another command.
can some one correct the above...
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
I am being told by serveral different departmens that serveral of the products we use such as Oracle, IONA orbix 3.0, Veritas NetBackup and Tivoli Maestro are about to end support of Error Correction Support. Could some please help me understand what this actually means. Thanks Kristian (1 Reply)
Discussion started by: kristian
1 Replies
2. Shell Programming and Scripting
Here is what old matrix look like,
IDs X1 X2 Y1 Y2
10914061 -0.364613333 -0.362922333 0.001691 -0.450094667
10855062 0.845956333 0.860396667 0.014440333 1.483899333... (7 Replies)
Discussion started by: ssshen
7 Replies
3. Shell Programming and Scripting
Hi,
I'm trying to pick out a data field eg. from below. I need the required field as below but they are filled sometimes with weird chars like \-(. or watever. How can I accurately extract the 3rd field in shell? :confused:
ID IDNO - REQUIRED FIELD
ID 1447 - MAT620BR.
ID 1452 -... (13 Replies)
Discussion started by: uxnoob
13 Replies
4. Shell Programming and Scripting
My input file:
data_5 Ali 422 2.00E-45 102/253 140/253 24
data_3 Abu 202 60.00E-45 12/23 140/23 28
data_1 Ahmad 256 7.00E-45 120/235 140/235 22
data_4 Aman 365 8.00E-45 15/65 140/65 20
data_10 Jones 869 9.00E-45 65/253 140/253 18... (12 Replies)
Discussion started by: patrick87
12 Replies
5. Shell Programming and Scripting
My input:
Data name: ABC001
Data length: 1000
Detail info
Data Direction Start_time End_time Length
1 forward 10 100 90
1 forward 15 200 185
2 reverse 50 500 450
Data name: XFG110
Data length: 100
Detail info
Data Direction Start_time End_time Length
1 forward 50 100 50 ... (11 Replies)
Discussion started by: patrick87
11 Replies
6. Shell Programming and Scripting
input
cz1 87942437 87952030 M_001144992 0 + 87942537 87949664 0 3 710,114,2506, 0,2725,7087,
script
awk '{
n11 = split($11, t11, ",")
n12 = split($12, t12, ",")
for (i = 0; ++i < n11;) {
s12 = $2 + t12
print $4"_xon"i, "\t",$4"_xon"i,"\t", $1,... (1 Reply)
Discussion started by: quincyjones
1 Replies
7. UNIX for Dummies Questions & Answers
Sir,
I have the following modules to learn. The details of the modules in the syllabus published by the university are given below. There are some huge spelling mistakes in the syllabus. I have corrected few of them. Can u please quote the spelling mistakes in the syllabus if any and kindly... (1 Reply)
Discussion started by: achuthmama
1 Replies
8. Shell Programming and Scripting
Hi, Great minds, I have some files, in fact header files, of CTD profiler, I tried a lot C programming, could not get output as I was expected, because my programming skills are very poor, finally, joined unix forum with the hope that, I may get what I want, from you people,
Here I have attached... (17 Replies)
Discussion started by: nex_asp
17 Replies
9. Shell Programming and Scripting
I am checking if ssh is working fine on remote server proceed for next step until keep check ssh port, below is shell script.
#!/bin/bash
MON="SSH"
x=1
while
do
echo "SSH Checking Status"
nc 192.168.1.20 -w 2
done (3 Replies)
Discussion started by: learnbash
3 Replies
10. Shell Programming and Scripting
if awk 'BEGIN{if('$RSS'>='1000')exit 0;exit 1}' ; then
dowhatever
fi
the above code works great when i'm comparing numerical figures.
but when i try to do a string comparison, it does not work:
if awk 'BEGIN{ /'$RSS'/ ~ /DB01/ exit 0;exit 1}' ; then
dowhatever
fi
can this... (2 Replies)
Discussion started by: SkySmart
2 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)