Help answer threads with 0 replies.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 04-15-2007, 01:34 AM   #1
LQ Newbie
Registered: Dec 2006
Posts: 16

Rep: Reputation: 0
awk error 'Invalid collation character: '


I have a simple awk script for counting words:
x = $0
while (match(x, /[a-zA-Z\252\272\300-\377]('?[a-zA-Z\252\272\300-\377])*/)) {
tally[tolower(substr(x, RSTART, RLENGTH))]++
x = substr(x, RSTART+RLENGTH)
for (x in tally) printf "%7d %s\n", tally[x], x

when i run the command gawk -f count.awk on the computers at the university it works as expected. However when I do the same command on my linux machine at home I get this error message:

gawk: count.awk:3: fatal: Invalid collation character: /[a-zA-Z���-�]('?[a-zA-Z���-�])*/

Both computers are running fedora6.

Why would it be doing this?


Old 04-15-2007, 01:44 AM   #2
LQ Guru
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
Hi -

The error indicates the problem might be locale-related.

See if there is any difference between the $LANG environment variable on your home system and your school's. Here's a link with more information on "locale" settings under Linux:

'Hope that helps .. PSM


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Insert character by using sed/awk manish_meet_in Linux - General 3 04-05-2007 12:19 PM
awk escape character for colon in string quadmore Programming 2 02-27-2007 04:56 PM
xen installation error: error 13: invalid or unsupported executable format Niceman2005 Linux - Software 0 01-05-2007 01:51 AM
AWK: print field to end, and character count? ridertech Linux - Newbie 1 05-07-2004 05:07 PM
Invalid or incomplete multibyte or wide character chanys Linux - General 1 03-13-2003 10:09 PM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 09:24 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration