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.

Hello:
I am trying to use grep in cygwin to do the following, however I am unable to get the output in the desired format.

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

My search this morning was about how could I compare two decimal numbers in bash, and I came to this answser: How to compare to floating point number in a shell script.