ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Welcome to LinuxQuestions.org, a friendly and active Linux Community.

You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!

Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.

If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.

Having a problem logging in? Please visit this page to clear all LQ-related cookies.

Introduction to Linux - A Hands on Guide

This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.

Click Here to receive this Complete Guide absolutely free.

Awk works in double precision but it's not aware of the fortran D notation. You should first convert D to E. Following my previous suggestion (but it can be applied for all the others) you can try something like:

thnx again! This one set a single mulitplied column with line numbers, but the multiplication is wrong again. And only the first column is printed.
Now I have the feeling that I'm bugging you all too much.

If you try my next one from post #22 it includes the factor parameter

Hi!
I'm sorry, but I don't understand two things.
1] Is this a shell script or a perl script?
2] Where is the line in which the names of the input and output files should be stated?

post #1 - input table must be printed out in column order (row number added)
post #10 - fields in the input table are separated by two spaces
post #13 - data are numbers in scientific notation and need to be multiplied by a constant factor
post #32 - input table must be printed out in row order (column number added)
post #35 - input table must be printed out in column order
post #37 - the result of the multiplication by the given factor 219474.6306726 is wrong.
post #37 - maybe input changed again (since the assertion "only the first column is printed" is false).

Quote:

Now I have the feeling that I'm bugging you all too much.

Just a little! Please Igor, we only need to know two simple things at this point:
1) Which is the actual input (two or three rows of data are enough)
2) What should be the exact and final output (data already multiplied and written in the desired format)

And eventually what is the scripting language of your choice (one for which you're already skilled or one you feel it's worth to learn). I'm trying only to bring this challenging but confused thread to a more straight direction.

post #1 - input table must be printed out in column order (row number added)
post #10 - fields in the input table are separated by two spaces
post #13 - data are numbers in scientific notation and need to be multiplied by a constant factor
post #32 - input table must be printed out in row order (column number added)
post #35 - input table must be printed out in column order
post #37 - the result of the multiplication by the given factor 219474.6306726 is wrong.
post #37 - maybe input changed again (since the assertion "only the first column is printed" is false).

Just a little! Please Igor, we only need to know two simple things at this point:
1) Which is the actual input (two or three rows of data are enough)
2) What should be the exact and final output (data already multiplied and written in the desired format)

And eventually what is the scripting language of your choice (one for which you're already skilled or one you feel it's worth to learn). I'm trying only to bring this challenging but confused thread to a more straight direction.

Hi!
I appreciate your effort to clarify the "problem". At one moment today, I was also confused by numerous suggestions, I kind of got lost in answering them all. I think that I even hadn't answered them all, and I should have

The scripting language is not important...I'll accept everything I'm not skilled at any one. I just found awk command very useful to perform operations on column data, so I started with it.

post#32 I see that my scribling on the side of the 2nd column messed things up. Post #35 is correct.

1)
These are the first three input lines (6 columns & 141 rows)

I remembered that someone already posted that one can change D into E with sed command. Then, would awk recognize numbers with E and multiply correctly? Grail got the multiplication ok in his post from 11:35 today, but the line numbers were not.

LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.