Hi All,
How to remove a box like special character which appears at the end of a string/line/record. I have no clue what this box like special character is. It is transparent square like box. This appears in a .DAT file at the end of header.
I'm to compare a value in header with a parameter.... (16 Replies)
Hi All,
I have named a file with current date,time and year as follows:
month=`date | awk '{print $2}'`
date=`date | awk '{print $3}'`
year=`date | awk '{print $6}'`
time=`date +%Hh_%Mm_%Ss'`
filename="test_"$month"_"$date"_"$year"_"$time".txt"
> $filename
The file is created with a... (2 Replies)
Hi Friends,
I have .txt file which has 13000 records.
Each record is 278 character long.
I am using below code to extract the string and it takes almost 10 minutes.
Any suggestion please.
cat filename.txt|while read line
do
f1=`echo $line|awk '{print substr($1,1,9)}'`
f2=`echo... (6 Replies)
I have a file with "@" in every line
fdgfgddfg@sfsdfdsf@dfdfd@@vfdfsdfd@
sfsdfs@sdfd@gfhfgh@@ddffg@sdf@
srfgtfsdfs@sdfertrd@eergfhfgh@@ddffg@sdf@
wttrtrt@sdfd@sdfdf@@sdfdfds@@@
I need to remove all the fourth and onwards occurences of "@".
so my final o/p would be
fdgfgddfg@sfsdfdsf@dfdfd@... (7 Replies)
I need to remove new line character from end of file.
Suppose here are content.
a|b|c|d|r
a|b|c|d|r
a|b|c|d|r
<new line>
that means file contains 4 lines but data is there in 3 lines.
so I want that only 3 lines should be there in file.
Please help (20 Replies)
Hi,
I am trying to remove lines once a string is found till another string is found including the start string and end string. I want to basically grab all the lines starting with color (closing bracket). PS: The line after the closing bracket for color could be anything (currently 'more').... (1 Reply)
how to Remove comma as last charector in end of last line of file:
example:
input file
---------------
aaaaaa,
bbbbbb,
cccc,
12345,
____________
output file :
-----------
aaaaaa,
bbbbbb, (6 Replies)
Hi,
How can I generate a string of random characters (alpha+numeric) of a particular length ?
For e.g. for
n=5, output = 'kasjf'
n=10, output = 'hedbcd902k'
Also, please let me know if random (valid) dates could also be generated.
Thanks (7 Replies)
Good day, I am a newbie here and thanks for accepting me
I have a task to modify input data where my input data looks like
123|34567|CHINE
1|23|INDIA
34512|21|USA
104|901|INDIASee that my input has two columns with different character length but max length is 5 and minimum length is 0 which... (1 Reply)
im trying to get
awk to print the string between 3rd and 4th backslashs to end of line
test could be any word
this
http://example.com/test/ >to this
http://example.com/test/ > testalso the other way round insert string at end of line... (13 Replies)
Discussion started by: bob123
13 Replies
LEARN ABOUT OPENSOLARIS
srand
rand(3UCB) SunOS/BSD Compatibility Library Functions rand(3UCB)NAME
rand, srand - simple random number generator
SYNOPSIS
/usr/ucb/cc [ flag ... ] file ...
int rand();
int srand(seed)
unsigned seed;
DESCRIPTION
rand() uses a multiplicative congruential random number generator with period 2^32 to return successive pseudo-random numbers in the range
from 0 to 2^31 -1.
srand() can be called at any time to reset the random-number generator to a random starting point. The generator is initially seeded with a
value of 1.
SEE ALSO cc(1B), drand48(3C), rand(3C), random(3C)NOTES
Use of these interfaces should be restricted to only applications written on BSD platforms. Use of these interfaces with any of the system
libraries or in multi-thread applications is unsupported.
The spectral properties of rand() leave a great deal to be desired. drand48(3C) and random(3C) provide much better, though more elaborate,
random-number generators.
The low bits of the numbers generated are not very random; use the middle bits. In particular the lowest bit alternates between 0 and 1.
SunOS 5.11 30 Oct 2007 rand(3UCB)