Results 1 to 7 of 7
please vist the page first
awk problem...
- 10-08-2007 #1Just Joined!
- Join Date
- Aug 2007
- Posts
- 6
- 10-08-2007 #2Linux User
- Join Date
- Aug 2006
- Posts
- 458
its RSTART, not RESTARTCode:... print "Thanks to****"substr(topname,RESTART) ...
- 10-08-2007 #3Just Joined!
- Join Date
- Aug 2007
- Posts
- 6
- 10-08-2007 #4Linux User
- Join Date
- Aug 2006
- Posts
- 458
show your error messages etc...i am not going to guess what happened.
- 10-08-2007 #5Just Joined!
- Join Date
- Aug 2007
- Posts
- 6
ok. please vist again.
i paste 2 pics of my error on it .
I can’t print “***THANKS Dan***” but ”***THANKS Dan Savage”.
print "Thanks to****"substr(topname,RSTART,4)"****" was not a good idea.
Second, I can’t print the sorted names if the last “Thanks to ……” is needed.
Listed are their names (sorted by last names) and phone numbers:
John Goldenrod--(916) 348-4278
Mike Harrington--(510) 548-1278
Archie McNichol--(206) 548-1348
Guy Quigley--(916) 343-6410
Dan Savage--(406) 298-7744
Tom Savage--(40
926-3456
Elizabeth Stachelin--(916) 440-1763
Thanks to all of you for your continued support!
- 10-09-2007 #6Linux User
- Join Date
- Aug 2006
- Posts
- 458
you could try :
1) sort -k2 instead of sort +1
2) try split(topname...) instead of match().
3) instead of system("cat tmp") , you can try
however, i suspect you don't have to use this anymore since you have already print them out with the sort...Code:while ( ( getline line < "/path/tmp" ) > 0 ) { print line }
- 10-10-2007 #7Just Joined!
- Join Date
- Aug 2007
- Posts
- 6
First, Thanks a lot.
Secrond,could be ok in freebsd,Code:"sort +1"
could be right in debian.Code:"sort -k +1"
Third,may work sometimes, that's quite strange!Code:system("cat tmp")
Forth,worked beter than system("cat tmp")Code:while ( ( getline line < "/path/tmp" ) > 0 ) { print line }
thanks again!


Reply With Quote
