Solved

using sed to select csv field and remove first (leading) character

Posted on 2004-09-18
1
648 Views
Last Modified: 2013-12-05
Having exported data from an MS Access database to csv format I have now realised that the currency fields are in format ...,£1234.56,...

Once the csv file is shifted onto Linux and the command "head --lines=10 file.csv" is run the system seems incapable of reading the £ sign and it looks like a blank space.  However when I try and copy and paste any part of the output which contains the 'space' it will not function (any other part of the output can be copied and pasted).

Is there some way sed can strip this unknown character out of the csv, or is there alternatively some way to make Linux recognise this character correctly?

By the way, changing the fields to not be currency in MS Access is not an option.

Thanks in advance
0
Comment
Question by:MitchBroadhead
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 23

Accepted Solution

by:
Mysidia earned 125 total points
ID: 12092936
perl -pe 's/\243//g'   -i.bak  filename.csv

To use sed you'd need to embed the character

sed s/£//g

Try doing this inside a gnome-terminal or xterm instead of the console if that's what you're doing..

I guess you're using an older Linux distribution?
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Creating a Samba server for a small office. Ubuntu Linux and Samba can breathe new life into a retired PC and save an office money on new hardware/software. Our example server will have two hard disks, one exclusively for storing shared data. …
If you use Debian 6 Squeeze and you are tired of looking at the childish graphical GDM login screen that is used by default, here's an easy way to change it. If you've already tried to change it you've probably discovered that none of the old met…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question