Solved

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

Posted on 2004-09-18
1
649 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

The purpose of this article is to fix the unknown display problem in Linux Mint operating system. After installing the OS if you see Display monitor is not recognized then we can install "MESA" utilities to fix this problem or we can install additio…
The purpose of this article is to demonstrate how we can upgrade Python from version 2.7.6 to Python 2.7.10 on the Linux Mint operating system. I am using an Oracle Virtual Box where I have installed Linux Mint operating system version 17.2. Once yo…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

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