Special character ^@ in CSV file | Unix Linux Forums | Red Hat

  Go Back    


Red Hat Red Hat is the world's leading open source technology solutions provider with offerings including Red Hat Enterprise Linux (RHEL), Fedora, open source applications, security and systems management, virtualization, and Services Oriented Architecture (SOA) solutions.

Special character ^@ in CSV file

Red Hat


Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 07-11-2013
donadarsh donadarsh is offline
Registered User
 
Join Date: Jul 2010
Last Activity: 16 July 2013, 11:01 AM EDT
Location: Bangalore, India
Posts: 73
Thanks: 4
Thanked 13 Times in 13 Posts
Special character ^@ in CSV file

All,

I am having a tough time with Linux and CSV file. My CSV file gets generated from Cognos on Linux machine that contains special characters. At first instance when I do vi <filename> to that file, I can't see anything. I did tail -2 and redirected to another temp file and did vi <filename> , I can see control characters ^@. I can remove those characters manually by using :%s/^@//g in vi editor. But, the process need to be done automatically as its all automated. Its needs to be done from shell script. The same file came with some other special character in Solaris and was easy to remove.

Any help would be appreciated.
Sponsored Links
    #2  
Old 07-11-2013
vidyadhar85's Avatar
vidyadhar85 vidyadhar85 is offline Forum Advisor  
The Tutor
 
Join Date: Jun 2008
Last Activity: 9 April 2014, 1:31 AM EDT
Location: INDIA, Bangalore
Posts: 2,049
Thanks: 16
Thanked 106 Times in 102 Posts
why dot you try tr, sed or awk to replace the special character in your script?

worst case u can do


Code:
 
vi - you_file_name<<!
:%s/^@//g
:wq
!

Sponsored Links
    #3  
Old 07-11-2013
donadarsh donadarsh is offline
Registered User
 
Join Date: Jul 2010
Last Activity: 16 July 2013, 11:01 AM EDT
Location: Bangalore, India
Posts: 73
Thanks: 4
Thanked 13 Times in 13 Posts
@Vidya

I did try sed but got error every time. Your solution might help...

Thanks...
Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Square like special characters in .csv file Sanchalla Shell Programming and Scripting 5 12-28-2012 11:41 AM
Replace newline character character in a column in csv file aneeta13 UNIX for Dummies Questions & Answers 20 08-09-2012 03:28 PM
Removing Special Character from File. pinnacle Shell Programming and Scripting 6 08-30-2010 10:44 AM
Special character in my file Ryan2786 UNIX for Dummies Questions & Answers 3 07-05-2007 11:35 PM
delete a special character in file srivsn Shell Programming and Scripting 1 03-15-2006 05:45 AM



All times are GMT -4. The time now is 01:28 PM.