×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Awk Command not able to read French/Spanish characters from a file

Awk Command not able to read French/Spanish characters from a file

Awk Command not able to read French/Spanish characters from a file

(OP)
Using Awk Commmand I am trying to get value of a column in .csv file which contains French/Spanish characters. When Viewing file through View command French/Spanish characters are printed properly but using awk/head command it removes French/Spanish . Sample Data - Vinêâêîôûcédille characters.

Awk Command Output - Vin▒▒▒▒▒▒c▒dille

Head Command output - "Vin▒▒▒▒▒▒c▒dille

Expected Output - Vinêâêîôûcédille

Please see code and output snippet below

view Package_UTF8.txt

"dE82WVJ","CmFX","COMPLETED","false","Vinêâêîôûcédille TEST","en","PACKAGE","2022-07-20T18:15:13Z","","Vinêâêîôûcédille","2022-07-20T18:16:04Z","true","Electronic Disclosures and Signatures Consent","false","default-consent","tO6YRDDweek5","Vi","Ma","","","vi.ma@xyz.com","null","en","","","tO6YRDDweek5","0","null","2022-06-23T17:04:10Z","2022-06-29T21:50:14Z","ACTIVE","REGULAR","false","Vi_Ma_tO6YRDDweek5_Vinêâêîôûcédille_20220720T181513Z"

awk -F "," 'NR==2 {print ($34) }' Package_UTF8.txt;

"Vi_Ma_tO6YRDDweek5_Vin▒▒▒▒▒▒c▒dille_20220720T181513Z"

'head -2 Package_UTF8.txt'

"dE82WVJ","CmFX","COMPLETED","false","Vin▒▒▒▒▒▒c▒dille TEST","en","PACKAGE","2022-07-20T18:15:13Z","","Vin▒▒▒▒▒▒c▒dille","2022-07-20T18:16:04Z","true","Electronic Disclosures and Signatures Consent","false","default-consent","tO6YRDDweek5","Vi","Ma","","","vi.ma@xyz.com","null","en","","","tO6YRDDweek5","0","null","2022-06-23T17:04:10Z","2022-06-29T21:50:14Z","ACTIVE","REGULAR","false","Vi_Ma_tO6YRDDweek5_Vin▒▒▒▒▒▒c▒dille_20220720T181513Z"

RE: Awk Command not able to read French/Spanish characters from a file

It worked for me on Linux.

I used this file
Package_UTF8.txt

CODE

"dE82WVJ","CmFX","COMPLETED","false","Vinêâêîôûcédille TEST","en","PACKAGE","2022-07-20T18:15:13Z","","Vinêâêîôûcédille","2022-07-20T18:16:04Z","true","Electronic Disclosures and Signatures Consent","false","default-consent","tO6YRDDweek5","Vi","Ma","","","vi.ma@xyz.com","null","en","","","tO6YRDDweek5","0","null","2022-06-23T17:04:10Z","2022-06-29T21:50:14Z","ACTIVE","REGULAR","false","Vi_Ma_tO6YRDDweek5_Vinêâêîôûcédille_20220720T181513Z" 

and got this result


You didn't mention what OS you are using.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close