Sponsored Content
Top Forums Shell Programming and Scripting Working with extended keyboard characters Post 302296264 by joeyg on Tuesday 10th of March 2009 05:20:29 PM
Old 03-10-2009
Question Working with extended keyboard characters

I will be reading a file (file_in) with name & address and a word that I may need to convert. Running unix on a pc, this would be easy. But on my Solaris I am not getting the desired results.

If my file_in contains:
Code:
Joe|Smith|123 Main Street|E|Vehicle
Nicky|Dufour|1 Ste. Catherines|F|Vehicle

and my
conversion file is:
Code:
E|Vehicle|Vehicle
F|Vehicle|Véhicule

and I want to create:
Code:
Joe|Smith|123 Main Street|E|Vehicle
Nicky|Dufour|1 Ste. Catherines|F|Véhicule

which after a whole bunch more programming is ftp'd to my pc network for printing.

I know how to figure this out with awk, etc.. My problem is when I ftp that conversion file to my unix, I end up with wrong characters. In fact, I end up with something like "V\202\hicle" when I vi the file. (Which is correct since the 202 in octal is the e with accent.)
But, this \202 representation garbles during processing and I end up with strange data at the end.

So, I am looking for tricks or hints for my Solaris unix (bash or ksh) to deal with extended characters.
Thanks in advance.
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Keyboard not working properly...

Hello Again, Those that have noticed my earlier posts will know that I have succesfully installed Solaris 8 onto my pc. I haven't been able to get x-server working (i think it doesn't like my video card) though I've been able to log into root (with a bit of help from unix forums :o ) and have... (2 Replies)
Discussion started by: timresh
2 Replies

2. AIX

keyboard and mouse not working in graphical login

Dear frnz I face a weird issue with p275 workstation with Aix 5.1 After booting the workstation i am getting dt login screen and i am not able to key in user name and passwd .The mouse pointer is moving but the mouse buttons doesnt work. i am able to login through rsh to the machine... (1 Reply)
Discussion started by: sriram.s
1 Replies

3. Shell Programming and Scripting

extended characters in UNIX

Hi Guys, I am using db2 load to load from a csv file to a table. Problem is that extended characters ™,®,é,º do not get loaded correctly. Its a UTF 8 format csv and i am using codepage=1208 for the load. Does anybody have an idea on this? Thanks (2 Replies)
Discussion started by: lifzgud
2 Replies

4. Solaris

Keys on Keyboard stop working

Hello, I hope I put this in the right forum... I searched for similar threads, but I couldn't find any that seem to deal with the problem I am having. My workplace is using (among other Solaris-machines) Dell Dimension T3500 as workstations (running Solaris 10 X86 10/09 u8,... (0 Replies)
Discussion started by: areichart
0 Replies

5. AIX

Keyboard Mouse Display not working with Pseries

Hello, Just got a refurbished Pseries when I boot the machine , everything is okay, that is no attention light and panel shows 01 B N but there is nothing on the display ( monitor / console ) which is plugged into the video card port of pseries. The display is empty.... The keyboard... (3 Replies)
Discussion started by: filosophizer
3 Replies

6. Shell Programming and Scripting

Identify extended ascii characters in a file

Hi, Is there a way to identify the lines in a file having extended ascii characters and display the same? For instance I have a file abc.txt having below data aaa|bbb|111|This is first line aaa|bbb|222|This is secõnd line aaa|bbb|333|This is third line aaa|bbb|444|This is foùrth line... (3 Replies)
Discussion started by: decci_7
3 Replies

7. Shell Programming and Scripting

Search and Replace Extended Ascii Characters

We are getting extended Ascii characters in the input file and my requirement is to search and replace them with a space. I am using the following command LANG=C sed -e 's// /g' It is doing a good job, but in some cases it is replacing the extended characters with two spaces. So my input... (12 Replies)
Discussion started by: ysvsr1
12 Replies

8. Programming

How to read extended ASCII characters from stdin?

Hi, I want to read extended ASCII characters from keyboard using c language on unix/linux. How to read extended characters from keyboard or by copy-paste in terminal irrespective of locale set in the system. I want to read the input characters from keyboard, store it in an array or some local... (3 Replies)
Discussion started by: sanzee007
3 Replies

9. Shell Programming and Scripting

Extended ASCII Characters keep on getting reintroduced to text files

I am working with a log file that I am trying to clean up by removing non-English ASCII characters. I am using Bash via Cygwin on Windows. Before I start I set: export LC_ALL=C I clean it up by removing all non-English ASCII characters with the following command; grep -v $''... (4 Replies)
Discussion started by: lewk
4 Replies
Sub::Exporter::ForMethods(3pm)				User Contributed Perl Documentation			    Sub::Exporter::ForMethods(3pm)

NAME
Sub::Exporter::ForMethods - helper routines for using Sub::Exporter to build methods VERSION
version 0.091970 SYNOPSIS
In an exporting library: package Method::Builder; use Sub::Exporter::ForMethods qw(method_installer); use Sub::Exporter -setup => { exports => [ method => '_method_generator' ], installer => method_installer, }; sub _method_generator { my ($self, $name, $arg, $col) = @_; return sub { ... }; }; In an importing library: package Vehicle::Autobot; use Method::Builder method => { -as => 'transform' }; DESCRIPTION
The synopsis section, above, looks almost indistinguishable from any other use of Sub::Exporter, apart from the use of "method_installer". It is nearly indistinguishable in behavior, too. The only change is that subroutines exported from Method::Builder into named slots in Vehicle::Autobot will be wrapped in a subroutine called "Vehicle::Autobot::transform". This will insert a named frame into stack traces to aid in debugging. More importantly (for the author, anyway), they will not be removed by namespace::autoclean. This makes the following code work: package MyLibrary; use Math::Trig qw(tan); # uses Exporter.pm use String::Truncate qw(trunc); # uses Sub::Exporter's defaults use Sub::Exporter::ForMethods qw(method_installer); use Mixin::Linewise { installer => method_installer }, qw(read_file); use namespace::autoclean; ... 1; After MyLibrary is compiled, "namespace::autoclean" will remove "tan" and "trunc" as foreign contaminants, but will leave "read_file" in place. It will also remove "method_installer", an added win. EXPORTS
Sub::Exporter::ForMethods offers only one routine for export, and it may also be called by its full package name: method_installer This routine returns an installer suitable for use as the "installer" argument to Sub::Exporter. It updates the "@to_export" argument to wrap all code that will be installed by name in a named subroutine, then passes control to the default Sub::Exporter installer. AUTHOR
Ricardo Signes <rjbs@cpan.org> COPYRIGHT AND LICENSE
This software is copyright (c) 2009 by Ricardo Signes. This is free software; you can redistribute it and/or modify it under the same terms as perl itself. perl v5.10.1 2009-07-16 Sub::Exporter::ForMethods(3pm)
All times are GMT -4. The time now is 02:26 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy