Chemist Needs Help


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Chemist Needs Help
# 15  
Old 10-23-2008
Quote:
Originally Posted by jim mcnamara
Code:
cnt+=.1 } '  >> newfile    # <---  last line of code

Typo. My bad.
What about this error:

awk: cmd. line:1: (FILENAME=- FNR=1) fatal: not enough arguments to satisfy format string
`%.1f %s %s %s
'
^ ran out for this one

Thanks
# 16  
Old 10-24-2008
Error

Quote:
Originally Posted by gingburg
What about this error:

awk: cmd. line:1: (FILENAME=- FNR=1) fatal: not enough arguments to satisfy format string
`%.1f %s %s %s
'
^ ran out for this one

Thanks
I have a new error that reads as follows, I was wondering if anyone new how to solve this problem. Thanks for all the help Jim. Thanks, Lenny.
# 17  
Old 10-24-2008
copy and paste precisely what you have for code. Not what I gave you, but what you are trying that throws the error. I do not get that error.
# 18  
Old 10-24-2008
Quote:
Originally Posted by jim mcnamara
copy and paste precisely what you have for code. Not what I gave you, but what you are trying that throws the error. I do not get that error.
printf "%s\n%s\n%s\n%s\n" "comment" "x y x" "101" "4 7" > newfile
awk '/Done/ {print $2; exit}' Ar_b3lyp_pv5z.out | read col3
awk '/Done/ {print $2; exit}' Cl_b3lyp_pv5z.out | read col4
awk '/Done/ {print $2}' ArCl_b3lyp_pv5z.out | \
awk -v col4="$col4" -v col3="$col3" ' BEGIN { cnt =1.5 }
{printf("%.1f %s %s %s\n", cnt $0, col3 col4); cnt+=.1 }'>> newfile


Thats what I have the name of the files have been substituted. Thanks again.
# 19  
Old 10-24-2008
Code:
printf "%s\n%s\n%s\n%s\n" "comment" "x y x" "101" "4 7" > newfile
awk '/Done/ {print $2; exit}' Ar_b3lyp_pv5z.out | read col3
awk '/Done/ {print $2; exit}' Cl_b3lyp_pv5z.out | read col4
awk '/Done/ {print $2}' ArCl_b3lyp_pv5z.out | \
awk -v col4="$col4" -v col3="$col3" ' BEGIN { cnt =1.5 }
    {printf("%.1f %s %s %s\n", cnt, $0, col3 col4); cnt+=.1 }'>> newfile

There was a missing comma after the word "cnt" on the last line. I ran it with dummy files, zero errors. Copy and paste this back into your script. There are no syntax errors.
Logic errors, maybe.
# 20  
Old 10-24-2008
Quote:
Originally Posted by jim mcnamara
Code:
printf "%s\n%s\n%s\n%s\n" "comment" "x y x" "101" "4 7" > newfile
awk '/Done/ {print $2; exit}' Ar_b3lyp_pv5z.out | read col3
awk '/Done/ {print $2; exit}' Cl_b3lyp_pv5z.out | read col4
awk '/Done/ {print $2}' ArCl_b3lyp_pv5z.out | \
awk -v col4="$col4" -v col3="$col3" ' BEGIN { cnt =1.5 }
    {printf("%.1f %s %s %s\n", cnt, $0, col3 col4); cnt+=.1 }'>> newfile

There was a missing comma after the word "cnt" on the last line. I ran it with dummy files, zero errors. Copy and paste this back into your script. There are no syntax errors.
Logic errors, maybe.

Still getting the error, could I attach the .out files

awk: cmd. line:1: (FILENAME=- FNR=1) fatal: not enough arguments to satisfy format string
`%.1f %s %s %s
'
^ ran out for this one

Thanks Jim.
# 21  
Old 10-24-2008
{printf("%.1f %s %s %s\n", cnt, $0, col3, col4);

One more comma after col3. I must have done that but I can't see how. It works here.
hmmm. Sorry.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

1 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Chemist Needs Help part II

Hello friends, I was wondering if you can help me with probably a simple function to you all: the sample looks and has this format. I was wondering how I could extract the first and second column starting including the line 'E/N and Ko' and not stop until there are no more lines. Thank you for... (5 Replies)
Discussion started by: gingburg
5 Replies
Login or Register to Ask a Question