Error message while using awk


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Error message while using awk
# 1  
Old 04-09-2010
Error message while using awk

Hi Friends,
I am using the below code in my script:
Code:
 
elif [ $1 != 'Cindy' -a  `echo $Line | grep -ce 'Larry' -e 'Joe' -e 'Bryan' -e 'Lane'` -gt 0 ]
    then
      NEW_LINE=`echo $Line | awk '{sub ($4, "2010\\\/04\\\/07"); printf "# %s %9s %18s\n", $2,$3,$4}'`
      sed $n" s/.*/$NEW_LINE/" kfile > tmp
      mv tmp kfile
    fi

Around 30 lines are replaced by this code correctly. But when it replaces 5th, 6th, 7th lines, it displaces error message as shown below:
Code:
awk: 0602-521 There is a regular expression error.
\(\) or () imbalance.
The input line number is 1.
The source line number is 1.
awk: 0602-521 There is a regular expression error.
\(\) or () imbalance.
The input line number is 1.
The source line number is 1.
awk: 0602-521 There is a regular expression error.
\(\) or () imbalance.
The input line number is 1.
The source line number is 1.

I am not sure why I receive these messages though the functionality is achived and the lines are replaced correctly in the file.

Any ideas to avoid this message will be of great help.

Thanks,
Sugan
# 2  
Old 04-09-2010
Can you post the sample data? including 5th,6th and 7th lines?
# 3  
Old 04-09-2010
I found out the problem.
Code:
# usa4914     Joe         2010/02/17
# x3a4914     Joe         2010/02/17
# seh         Lane        2010/02/17
# IN01379     Larry       2010/02/17
# IN01379     Larry ( the same as FIW-LR AM)
# IN01379     Larry (the same as FIW-LR AM)

The format of original data in those lines were different. Hence the problem. Thanks.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

awk to supress error message with custom text

After a bash function is run the below file is produced: out_name.txt tab-delimeted Input Errors and warnings AccNo Genesymbol Variant Reference Sequence Start Descr. Coding DNA Descr. Protein Descr. GeneSymbol Coding DNA Descr. GeneSymbol Protein Descr. Genomic... (3 Replies)
Discussion started by: cmccabe
3 Replies

2. Shell Programming and Scripting

awk command - not a valid identifier message

Trying to run the following awk command : export com.mics.ara.server.tools.sch_reports.Runner.num_threads=`awk -F= '!/^#/ && /com.mics.ara.server.tools.sch_reports.Runner.num_threads/{print $2}' $BKUPDIR/env.properties` -bash: export:... (6 Replies)
Discussion started by: venhart
6 Replies

3. Shell Programming and Scripting

Extract XML message from a log file using awk

Dear all I have a log file and the content like this file name: temp.log <?xml version="1.0" encoding="cp850"?> <!DOCTYPE aaabbb SYSTEM '/dtdpath'> <aaabbb> <tranDtl> <msgId>000001</msgId> </tranDtl> ..... </aaabbb> ... ... (1 Reply)
Discussion started by: on9west
1 Replies

4. Shell Programming and Scripting

awk error message: division by zero attempted

Hi, I'm executing unixbench tool v4.1 on an embedded system and I'm getting these error messages: Execl Throughput 1 2 3awk: /unixbench/unixbench-4.1.0/pgms/loops.awk:38: (FILENAME=- FNR=4) fatal: division by zero attempted Pipe Throughput 1 2 3 4 5 6 7 8 9 10awk:... (3 Replies)
Discussion started by: rogelio
3 Replies

5. Shell Programming and Scripting

Division by zero error message in AWK

How can I modify my awk code to get rid of the divion by zero error message? If I run the script without an input file, it should return error message "Input file missing" but not divison by zero. Code: #!/bin/nawk -f BEGIN { if (NR == 0) {print "Input file... (4 Replies)
Discussion started by: Pauline mugisha
4 Replies

6. UNIX for Dummies Questions & Answers

Error message: What does it mean?

I get this error message in my maillog. Can someone tell me what it means? SYSERR(root): collect: I/O error on connection from mail-05.goomba.com I guess it means that the server could not connect to mail-06.goomba.com. Is my interpretation correct? Any idea why it happens? (1 Reply)
Discussion started by: mojoman
1 Replies

7. Shell Programming and Scripting

Grep/awk not getting the message correctly

I have a script which will take two file as the inputs and take the Value in file1 and search in file2 and give the output in Outputfile. #!/bin/sh #. ${HOME}/crossworlds/bin/CWSharedEnv.sh FILE1=$1 FILE2=$2 for Var in $(cat $FILE1);do echo $Var grep -i "$Var" $FILE2 done > Outputfile I... (2 Replies)
Discussion started by: SwapnaNaidu
2 Replies

8. Solaris

lp error message

Both of these messages are filling up the /var/adm/messages files on these two Sun boxes, goober and gomer. The print server is called gold. Jul 31 03:15:40 gold bsd-gw: request to ma28084.Solaris (unknown printer) from goober Jul 31 03:16:39 gold bsd-gw: request to ma28084.Solaris (unknown... (1 Reply)
Discussion started by: antalexi
1 Replies

9. UNIX for Advanced & Expert Users

Error message

I'm getting an error - symbol referencing errors. No output written to, etc Can anybody tell me why this is? (2 Replies)
Discussion started by: Dan Rooney
2 Replies

10. UNIX for Dummies Questions & Answers

error message

Hi All, occasionally my server gives this error messages "NOTICE:HTFS Out of inodes on HTFS dev hd (1/42)" why ?? Alice. (3 Replies)
Discussion started by: alisev
3 Replies
Login or Register to Ask a Question