I am trying to use sed to change the format of decimal numbers in a large CSV file before importing it into a SQLite database. They all have two decimal places, may be negative use comma as a decimal separator and are therefore escaped with double quotes.

I have a file full of coordinates of the form:

Code:
37.68899917602539 58.07500076293945 57.79100036621094
The numbers don't always have the same number of decimal points. I need to reduce the decimal points of all the numbers (there are 128 rows of 3 numbers) to 2.

In Excel 2011 for Mac, I have the following column of numbers:

0.139**
-0.131**
-0.135*
-0.053
0.139**
0.112*
0.183***

Some items are negative, and some have stars.

My goal is to have the column formatted so that 1) there are no zeros preceeding the decimal, and 2) the numbers are aligned at their decimal point, like so:

.139**
-.131**
-.135*
-.053
.139**
.112*
.183***

After reading a n

I'm using Excel 2010, and have a spreadsheet of simple numbers (they're 1-5 ratings for a range of questions), so I have questions across the top, and each person's responses as a separate row. The numbers are whole numbers, but each cell has an error checking marker saying 'Number Stored as Text'.

I'm using Excel 2010, and have a spreadsheet of simple numbers (they're 1-5 ratings for a range of questions), so I have questions across the top, and each person's responses as a separate row. The numbers are whole numbers, but each cell has an error checking marker saying 'Number Stored as Text'.

I have a data base of part numbers:

Code:
AAA Thing1
BBB Thing2
CCC Thing3
File one is a list of part numbers:

Code:
XXXX AAA234
XXXX BBB678
XXXX CCC2345
Is there a sed one-line that would compare a data base with and replace the part numbers so that the output looks like this?

Code:
XXXX AAA234 Thing1
XXXX BBB678 Thing2
XXXX CCC2345 Thing3

Moderator's Comments:

Well my requirement is to add filters in an edit text in such a manner that it can contain maximum value upto 6 digits and 2 digits after the decimal point.Well what I basically need is to allow users to input 6 digits at most and 2 digits after the decimal point at most .

For example

999999.99 is valid (6 digits and two digits after the decimal)

9999999 is not valid (& digits)

999.99 is

Hi,

can someone explain to me why the uk/us custom is to write numbers as .5 instead of 0.5?
I would think that the decimal point in such notation is quite easy to miss, so a quick glance could mistake if for a 5.
So is it beacause people were just lazy to add a redundant zero infront of the point, or is there some other thing that I am not aware of?

How can replace text with Linux shell (sed, awk, ...)

Input:

aaa decimal(6,3) null,
bbb decimal(12,3) not null,
ccc decimal(1,11) null,
ddd decimal(2,10) null,
ff decimal(10,1) null,

I want replace decimal(X,Y) with decimal:

aaa decimal null,
bbb decimal not null,
ccc decimal null,
ddd decimal null,
ff decimal null,