Jump to content
  • Advertisement
Sign in to follow this  
cucubird

Syntax error in awk programs

This topic is 4549 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, I am really having a hard time debugging awk programs as the error messages they give are so vague... I have tried writing a method in awk which allows the comparison of a source file with the DB gen_ListA() { awk ' NR==FNR{ split($0,db_rec,",") db_vara=db_rec[1] db_varb=db_rec[2] db_varc=db_rec[3] db_vard=db_rec[4] db_vare=db_rec[5] db_varf=db_rec[6] db_idx_str=(db_vara db_varb db_varc db_vard db_vare db_varf) gsub(/ /,"",db_idx_str) ######################syntax error db[FNR, db_idx_str]=$0 ######################syntax error next} { o_vara=substr($0,1,13) o_varb=substr($0,145,17) o_varc=substr($0,162,8) o_vard=substr($0,245,17) o_vare=substr($0,262,8) o_varf=substr($0,653,7) o_idx_str=(o_vara o_varb o_varc o_vard o_vare o_varf) gsub(/ /,"",o_idx_str)##############syntax error found=0 for(i in db) { split(i,dbidx,SUBSEP) if ( o_idx_str == dbidx[2] ) { found = 1 next } } if (found != 1 ) print }' $db_file $tmp_file > $list_A_file } However, I received errors at lines which i marked using # at the end...I got a syntax error and illegal statement there... Can someone please help and advise me on whats wrong with that syntax...Thanks a million...this is rather urgent for me... thanks a million

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!