Hi,
So I have a text file which I want to separate into separate text files. I would use the split command but the problem here is that the text file is separated by delimiters. For example:
blah
blah blah
------
more text
-----
and some more text
So basically the first part should be... (4 Replies)
i want to write a script in Bash Shell that accept a list of files.an example of file is
4334:234
322.345:32
234:3452 e.t.c
each file only contain lines like num1:num2
i want to count the lines of this file and find the summary of X=4334+322.345+234 and Y=234+32+3452 (1 Reply)
Hi Experts,
Im a new bee for scripting,
I would ned to do the following via linux shell scripting, I have an application which throws a log file, on each action of a particular work with the application, as sson as the action is done, the log file would vanish or stops updating there, the... (2 Replies)
hi all,
i have some file whoes contents are
0 /home8/mc09ats/UnixCw/a1
1 /home8/mc09ats/UnixCw/a2
2 /home8/mc09ats/b3
3 /home8/mc09ats/UnixCw/d1
i want to seperate the content following way...
fileindex= 0
filepath=... (4 Replies)
Give shell script....which takes two file names as input and compares the contents, is both are same delete second file's contents.....
I try with "diff"...... but confusion how to use "diff" with if ---else
Thanking you (5 Replies)
Hi All,
I have a file with contents :
cat >file1.sh
qw^A34^Aer
the command i am using is:
cut -f1,2,3 -d"^A" file1.sh
which gave output as:
qw^A34^Aer
and the command
cut -f2 -d"^A" file1.sh
gave an output :
A34
i need the output as : (15 Replies)
Hi,
I am facing issue while reading data from a file in UNIX. my requirement is to compare two files and for the text pattern matching in the 1st file, replace the contents in second file by the contents of first file from start to the end and write the contents to thrid file.
i am able to... (2 Replies)
Hi,
I have a No Delimiter variable length text file with following schema -
Column Name Data length
Firstname 5
Lastname 5
age 3
phoneno1 10
phoneno2 10
phoneno3 10
sample data - ... (16 Replies)
Hi one of the output of the command is as below
# sed -n "/CCM-ResourceHealthCheck:/,/---------/{/CCM-ResourceHealthCheck:/d;/---------/d;p;}" Automation.OutputZ$zoneCounter | sed 's/$/<br>/'
Resource List : <br>
*************************** 1. row ***************************<br>
... (2 Replies)
Hi,
Extremely new to Perl scripting, but need a quick fix without using TEXT::CSV
I need to read in a file, pass any delimiter as an argument, and convert it to bar delimited on the output. In addition, enclose fields within double quotes in case of any embedded delimiters.
Any help would... (2 Replies)
Discussion started by: JPB1977
2 Replies
LEARN ABOUT BSD
falloc
MALLOC(3F)MALLOC(3F)NAME
malloc, free, falloc - memory allocator
SYNOPSIS
subroutine malloc (size, addr)
integer size, addr
subroutine free (addr)
integer addr
subroutine falloc (nelem, elsize, clean, basevec, addr, offset)
integer nelem, elsize, clean, addr, offset
DESCRIPTION
Malloc, falloc and free provide a general-purpose memory allocation package. Malloc returns in addr the address of a block of at least
size bytes beginning on an even-byte boundary.
Falloc allocates space for an array of nelem elements of size elsize and returns the address of the block in addr. It zeros the block if
clean is 1. It returns in offset an index such that the storage may be addressed as basevec(offset+1) ... basevec(offset+nelem). Falloc
gets extra bytes so that after address arithmetic, all the objects so addressed are within the block.
The argument to free is the address of a block previously allocated by malloc or falloc; this space is made available for further alloca-
tion, but its contents are left undisturbed. To free blocks allocated by falloc, use addr in calls to free, do not use basevec(offset+1).
Needless to say, grave disorder will result if the space assigned by mallocorfalloc is overrun or if some random number is handed to free.
DIAGNOSTICS
Malloc and falloc set addr to 0 if there is no available memory or if the arena has been detectably corrupted by storing outside the bounds
of a block.
The following example shows how to obtain memory and use it within a subprogram:
integer addr, work(1), offset
...
call falloc ( n, 4, 0, work, addr, offset )
do 10 i = 1, n
work(offset+i) = ...
10 continue
The next example reads in dimension information, allocates space for two arrays and two vectors, and calls subroutine doit to do the compu-
tations:
integer addr, dummy(1), offs
read *, k, l, m
indm1 = 1
indm2 = indm1 + k*l
indm3 = indm2 + l*m
indsym = indm3 + k*m
lsym = n*(n+1)/2
indv = indsym + lsym
indtot = indv + m
call falloc ( indtot, 4, 0, dummy, addr, offs )
call doit( dummy(indm1+offs), dummy(indm2+offs),
. dummy(indm3+offs), dummy(indsym+offs),
. dummy(indv +offs), m, n, lsym )
end
subroutine doit( arr1, arr2, arr3, vsym, vec, m, n, lsym )
real arr1(k,l), arr2(l,m), arr3(k,m), vsym(lsym), v2(m)
...
FILES
/usr/lib/libU77.a
SEE ALSO malloc(3)4.3 Berkeley Distribution May 15, 1985 MALLOC(3F)