Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Insert text in datafile with uneven columns Post 302383407 by vidyadhar85 on Tuesday 29th of December 2009 02:31:31 PM
Old 12-29-2009
how you wanna generate that arbitrary number??
can you elaborate bit more??
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Combine a datafile with Master datafile, emergent!

Hi guys, my supervisor has asked me to solve the problem in 7 days, I've taken 3 days to think about it but couldn't figure out any idea. Please give me some thoughts with the following problem, I have index.database that has only index date: 1994 1995 1996 1997 1998 1999 I have... (6 Replies)
Discussion started by: onthetopo
6 Replies

2. AIX

How to insert dummy columns

Hi My requirement is as follows, I have a input feed coming for X as A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P; A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P; A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P; A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P; A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P; any other feed coming from Y is as ... (2 Replies)
Discussion started by: smolgara
2 Replies

3. Shell Programming and Scripting

How to insert some constant text at beginig of each line within a text file.

Dear Folks :), I am new to UNIX scripting and I do not know how can I insert some text in the first column of a UNIX text file at command promtp. I can do this in vi editor by using this command :g/^/s//BBB_ e,g I have a file named as Test.dat and it containins below text: michal... (4 Replies)
Discussion started by: Muhammad Afzal
4 Replies

4. Shell Programming and Scripting

Need to insert new text and change existing text in a file using SED

Hi all, I need to insert new text and change existing text in a file. For that I used the below line in the command line and got the expected output. sed '$a\ hi... ' shell > shell1 But I face problem when using the same in script. It is throwing the error as, sed: command garbled:... (4 Replies)
Discussion started by: iamgeethuj
4 Replies

5. Shell Programming and Scripting

Reversing numbers in a datafile of rows and columns

Hello, I've tried searching the forum for an answer to my question, but without any luck... I have a datafile looking simplified as follows: 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 I want to reverse it by rearranging all the numbers from last to... (16 Replies)
Discussion started by: mattings
16 Replies

6. UNIX for Dummies Questions & Answers

How to insert alternative columns and sort text from first column to second?

Hi Everybody, I am just new to UNIX as well as to this forum. I have a text file with 10,000 coloumns and each coloumn contains values separated by space. I want to separate them into new coloumns..the file is something like this as ad af 1 A as ad af 1 D ... ... 1 and A are in one... (7 Replies)
Discussion started by: Unilearn
7 Replies

7. Shell Programming and Scripting

sorting the datafile in an order given in second datafile

Hi, I have two files: first input file is having 7-8 columns, and second data file is like I want to arrange my datafile1 in the order given in second data file, by comparing the seconddatafile with the second column of first file and print the entire line....also if any... (2 Replies)
Discussion started by: CAch
2 Replies

8. UNIX for Dummies Questions & Answers

Removing columns from a text file that do not have any values in second and third columns

I have a text file that has three columns. But at the end of the text file, there are trailing lines that have missing second and third columns: 4 0.04972604 KLHL28 4 0.0497332 CSTB 4 0.04979822 AIF1 4 0.04983331 DECR2 4 0.04990344 KATNB1 4 4 4 4 How can I remove the trailing... (3 Replies)
Discussion started by: evelibertine
3 Replies

9. UNIX for Dummies Questions & Answers

[Solved] Uneven column to row conversion

Hi Unix Forum, I have a relatively easy question i suppose for which, however, until now i could not find a solution. I am working with a program that will give me an output file similar to the following: A 1 2 3 4 B 1 2 3 4 C 1 (9 Replies)
Discussion started by: Leander
9 Replies

10. UNIX for Dummies Questions & Answers

Match and insert columns

Hi, I've got two files to match. File one: a1 b c d e a2 b c d e a3 b c d e a4 b c d e and file 2 a1 1 2 3 4 a2 5 6 7 8 a3 9 10 11 12 a4 1 2 3 4 I need to match them by the first column and add the four columns of file 2 to the file 1 so that those added columns go as columns... (5 Replies)
Discussion started by: zajtat
5 Replies
drand48(3C)															       drand48(3C)

NAME
drand48(), erand48(), lrand48(), nrand48(), mrand48(), jrand48(), srand48(), seed48(), lcong48() - generate uniformly distributed pseudo- random numbers SYNOPSIS
Obsolescent Interfaces DESCRIPTION
This family of functions generates pseudo-random numbers using the well-known linear congruential algorithm and 48-bit integer arithmetic. In the following description, the formal mathematical notation [low,high) indicates an interval including low but not including high. and return nonnegative double-precision floating-point values uniformly distributed over the interval [0.0,1.0). and return nonnegative long integers uniformly distributed over the interval [0,2^31). and return signed long integers uniformly distributed over the interval [-2^31,2^31). and are initialization entry points, one of which should be invoked before either or is called. (Although it is not recommended practice, constant default initializer values are supplied automatically if or is called without a prior call to an initialization entry point.) and do not require an initialization entry point to be called first. All the routines work by generating a sequence of 48-bit integer values, X[i], according to the linear congruential formula X[n+1] = (a*X[n] + c) modulo m n>=0 The parameter m = 2^48; hence 48-bit integer arithmetic is performed. Unless has been invoked, the default multiplier value a and the default addend value c are given by a = 0x5DEECE66D (base 16) = 0273673163155 (base 8) c = 0xB (base 16) = 013 (base 8) The value returned by any of the functions or is computed by first generating the next 48-bit X[i] in the sequence. Then the appropriate number of bits, according to the type of data item to be returned, are copied from the high-order (leftmost) bits of X[i] and transformed into the returned value. The functions and store the last 48-bit X[i] generated in an internal buffer; that is why they must be initialized prior to being invoked. The functions and require the calling program to provide storage for the successive X[i] values in the array specified as an argument when the functions are invoked. That is why these routines do not have to be initialized; the calling program merely has to place the desired initial value of X[i] into the array and pass it as an argument. By using different arguments, and allow separate modules of a large pro- gram to generate several independent streams of pseudo-random numbers; i.e., the sequence of numbers in each stream do not depend upon how many times the routines have been called to generate numbers for the other streams. The initializer function sets the high-order 32 bits of X[i] to the 32 bits contained in its argument. The low-order 16 bits of X[i] are set to the arbitrary value 0x330E (base 16). The initializer function sets the value of X[i] to the 48-bit value specified in the argument array. In addition, the previous value of X[i] is copied into a 48-bit internal buffer, used only by and a pointer to this buffer is the value returned by This returned pointer, which can be ignored if not needed, is useful if a program is to be restarted from a given point at some future time; use the pointer to get at and store the last X[i] value, and then use this value to reinitialize via when the program is restarted. The initialization function allows the user to specify the initial X[i], the multiplier value a, and the addend value c. Argument array elements param[0-2] specify X[i], param[3-5] specify the multiplier a, and param[6] specifies the 16-bit addend c. After has been called, a subsequent call to either or restores the default multiplier and addend values for a and c, specified above. Obsolescent Interfaces generate uniformly distributed pseudo-random numbers. WARNINGS
and are obsolescent interfaces supported only for compatibility with existing DCE applications. New multithreaded applications should use and SEE ALSO
rand(3C), random(3M), thread_safety(5), random(7). STANDARDS CONFORMANCE
drand48(3C)
All times are GMT -4. The time now is 06:02 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy