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.

I have these ridiculously long real numbers such as 33.088117576394794, and I am trying to convert them to doubles (Two decimal places). So in this case, I want 33.09.

How do you do this in QML?

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

Dear all,
I have a .txt file with n=400 columns, n=440,000 rows. The file looks like below:
-0.0625123454 0.03732424 -0.11293423 ...
0.15651325435 -0.1366346346 -0.28384636 ...
...

I want to change all the numbers in the file with n=3 decimal places. I don't know if it is very simple problem but I don't know how to do it. Thanks a lot for your help.

thanks,
Lin

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: