• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 652
  • Last Modified:

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

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
MitchBroadhead
Asked:
MitchBroadhead
1 Solution
 
MysidiaCommented:
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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now