LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 11-26-2007, 01:01 PM   #1
freephoneid
LQ Newbie
 
Registered: Nov 2007
Posts: 4

Rep: Reputation: 0
Extra Character in Linux from CSV file


Hi All,
I've a CSV file in Windows which contains Registered trademark symbol. When I upload this file to Linux & try to see the contents from Vi editor, it shows some weird characted in place of the registered symbol character. However, when I do the cat command, it shows properly.

Can anyone tell me how to resolve this issue? I tried all the coomands (dos2unix, etc) of removing control-m characters but none of them worked.

Please help

Thanks!
 
Old 11-26-2007, 03:04 PM   #2
lakris
Member
 
Registered: Sep 2004
Location: Stockholm, Sweden
Distribution: Ubuntu, RedHat, SuSe, Debian, Slax
Posts: 102

Rep: Reputation: 15
You must have an application that can handle extended character sets, such UTF-8 and UTF-16, or rather, the specific char set the file is made in. As most terminal/character based applications are set for ASCII they handle extended characters very differently. It may display as lines of text with for example cat or less, but bash can't read script files with dos line breaks. Your term/x-term may be able to display UTF-8 characters but vi/vim can't. I'm sure there's a version of it that can. I think a few graphical text editors can recognise and handle those special (usually two-byte) characters.

Since You mentioned CSV, if the contents of the file is to be processed in a script, (for example to be re-used on a Windows machine or as Web-result), my experience is that the "funny" characters are kept intact. So if that is Your goal, don't worry to much about how it looks in vi, if the final target is something that can read extended character sets.

/Lakris
 
Old 11-26-2007, 04:20 PM   #3
freephoneid
LQ Newbie
 
Registered: Nov 2007
Posts: 4

Original Poster
Rep: Reputation: 0
Hi Lakris,
Thanks for your reply! My purpsose is to modify the file from linux. One of the automated program puts the file from windows to Linux. LAter we manually go to Linux box & change it if we want to.

Can you please suggest how can I change special characters??? Do I need to install anything?

Thanks!
 
  


Reply



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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
transfer a csv file from windows to linux uxan Fedora 1 08-30-2007 02:04 AM
C++ problem extracting a substring - extra character Nylex Programming 4 07-22-2007 11:21 AM
export redhat linux csv file to xls bbgtilak Linux - General 4 12-27-2006 07:53 AM
Extra character in complemented file. softnayr Programming 1 09-25-2004 11:54 AM
CSV File AMMullan Programming 2 11-10-2003 12:49 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 06:32 AM.

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