Sponsored Content
Full Discussion: perl split function
Top Forums Shell Programming and Scripting perl split function Post 302074397 by new2ss on Tuesday 23rd of May 2006 06:21:17 AM
Old 05-23-2006
perl split function

Code:
$mystring = "name:blk:house::";
print "$mystring\n";
@s_format = split(/:/, $mystring);

for ($i=0; $i <= $#s_format; $i++) {
print "index is $i,field is $s_format[$i]";
print "\n";
}
$size = $#s_format + 1;
print "total size of array is $size\n";

i am expecting my size to be 5, why is it only 3?
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

split function

Hi all! I am relatively new to UNIX staff, and I have come across a problem: I have a big directory, which contains 100 smaller ones. Each of the 100 contains a file ending in .txt , so there are 100 files ending in .txt I want to split each of the 100 files in smaller ones, which will contain... (4 Replies)
Discussion started by: ktsirig
4 Replies

2. Shell Programming and Scripting

Use split function in perl

Hello, if i have file like this: 010000890306932455804 05306977653873 0520080417010520ISMS SMT ZZZZZZZZZZZZZOC30693599000 30971360000 ZZZZZZZZZZZZZZZZZZZZ202011302942311 010000890306946317387 05306977313623 0520080417010520ISMS SMT ZZZZZZZZZZZZZOC306942190000 30971360000... (5 Replies)
Discussion started by: chriss_58
5 Replies

3. Shell Programming and Scripting

perl-like split function for bash?

Hi! I'm doing bash shell scripting and would like to know if bash had something similar to perl's split function? Ultimately, I want to split two strings (delimeter = '.') and compare each of their values. Thus, I figured putting them in an array would be easiest. So i.e.: String 1:... (5 Replies)
Discussion started by: eur0dad
5 Replies

4. Shell Programming and Scripting

perl:extract 169008 with split function on /atrclips/u90/2009/169_008

On a line in a file:: /atrclips/u90/2009/169_008/Y5288900/SATHSWR_P1/1809853_SATHSWR_P1.tif,00018098539415200901_SATHSWR_P1.tif How do I use the split function to extract 169008......I tried .... foreach my $line (@lines) { ... (3 Replies)
Discussion started by: bandar007
3 Replies

5. Homework & Coursework Questions

PERL split function

Hi... I have a question regarding the split function in PERL. I have a very huge csv file (more than 80 million records). I need to extract a particular position(eg : 50th position) of each line from the csv file. I tried using split function. But I realized split takes a very long time. Also... (1 Reply)
Discussion started by: castle
1 Replies

6. Homework & Coursework Questions

PERL split function

Hi... I have a question regarding the split function in PERL. I have a very huge csv file (more than 80 million records). I need to extract a particular position(eg : 50th position) of each line from the csv file. I tried using split function. But I realized split takes a very long time. Also... (0 Replies)
Discussion started by: castle
0 Replies

7. Shell Programming and Scripting

PERL split function

Hi... I have a question regarding the split function in PERL. I have a very huge csv file (more than 80 million records). I need to extract a particular position(eg : 50th position) of each line from the csv file. I tried using split function. But I realized split takes a very long time. Also... (1 Reply)
Discussion started by: castle
1 Replies

8. UNIX for Advanced & Expert Users

regular expression for split function in perl

Hi, Below is an example of a record I have, which I wish to split using the perl's split function and load it into an array. I am having tough time figuring out the exact reg-ex to perform the split. Given record: "a","xyz",0,2,48,"abcd","lmno,pqrR, stv",300,"abc",20, The delimiter to... (4 Replies)
Discussion started by: jghoshal
4 Replies

9. Shell Programming and Scripting

Perl split function

my @d =split('\|', $_); west|ACH|3|Y|LuV|N||N|| Qt|UWST|57|Y|LSV|Y|Bng|N|KT| It Returns d as 8 for First Line, and 9 as for Second Line . I want to Process Both the Files, How to Handle It. (3 Replies)
Discussion started by: vishwakar
3 Replies

10. UNIX for Dummies Questions & Answers

[Solved] Perl Question - split function with csv file

Hi all, I have a csv file that appears as follows: ,2013/03/26,2012/12/26,4,1,"2017/09/26,5.75%","2017/09/26,1,2018/09/26,1,2019/09/26,1,2020/09/26,1,2021/09/26,1",,,2012/12/26,now when i use the split function like this: my @f = split/,/; the split function will split the data that is... (2 Replies)
Discussion started by: WongSifu
2 Replies
mlib_VolumeRayCast_Blocked(3MLIB)			    mediaLib Library Functions				 mlib_VolumeRayCast_Blocked(3MLIB)

NAME
mlib_VolumeRayCast_Blocked, mlib_VolumeRayCast_Blocked_Parallel_Nearest_U8_U8, mlib_VolumeRayCast_Blocked_Parallel_Nearest_S16_S16, mlib_VolumeRayCast_Blocked_Parallel_Trilinear_U8_U8, mlib_VolumeRayCast_Blocked_Parallel_Trilinear_S16_S16, mlib_VolumeRay- Cast_Blocked_Divergent_Nearest_U8_U8, mlib_VolumeRayCast_Blocked_Divergent_Nearest_S16_S16, mlib_VolumeRayCast_Blocked_Divergent_Trilin- ear_U8_U8, mlib_VolumeRayCast_Blocked_Divergent_Trilinear_S16_S16 - cast a ray (or rays) through a 3D data set SYNOPSIS
cc [ flag... ] file... -lmlib [ library... ] #include <mlib.h> mlib_status mlib_VolumeRayCast_Blocked_Parallel_Nearest_U8_U8(mlib_rays *rays, const mlib_blkvolume *blk, void *buffer); mlib_status mlib_VolumeRayCast_Blocked_Parallel_Nearest_S16_S16(mlib_rays *rays, const mlib_blkvolume *blk, void *buffer); mlib_status mlib_VolumeRayCast_Blocked_Parallel_Trilinear_U8_U8(mlib_rays *rays, const mlib_blkvolume *blk, void *buffer); mlib_status mlib_VolumeRayCast_Blocked_Parallel_Trilinear_S16_S16(mlib_rays *rays, const mlib_blkvolume *blk, void *buffer); mlib_status mlib_VolumeRayCast_Blocked_Divergent_Nearest_U8_U8(mlib_rays *rays, const mlib_blkvolume *blk, void *buffer); mlib_status mlib_VolumeRayCast_Blocked_Divergent_Nearest_S16_S16(mlib_rays *rays, const mlib_blkvolume *blk, void *buffer); mlib_status mlib_VolumeRayCast_Blocked_Divergent_Trilinear_U8_U8(mlib_rays *rays, const mlib_blkvolume *blk, void *buffer); mlib_status mlib_VolumeRayCast_Blocked_Divergent_Trilinear_S16_S16(mlib_rays *rays, const mlib_blkvolume *blk, void *buffer); DESCRIPTION
Each of these functions casts a ray (or rays) through a three-dimensional(3D) data set, then computes and returns the interpolated samples at each step along the way. In trilinear interpolation, the value at point P is computed from its eight surrounding neighbors based on the equation below. P = (1-a)*(1-b)*(1-c)*P0 + a*(1-b)*(1-c)*Px + (1-a)*b*(1-c)*Py + (1-a)*(1-b)*c*Pz + a*b*(1-c)*Pxy + a*(1-b)*c*Pxz + (1-a)*b*c*Pyz + a*b*c*Pxyz where a, b, and c are the fractional parts of the coordinates of point P. The trilinear interpolation is represented by the following figure: Please see the online man page on docs.sun.com or a print copy for the diagram. Figure that represents the trilinear interpolation In nearest neighbor operation, the sample value at point P is replaced by the value of the nearest neighbor voxel. PARAMETERS
Each of the functions takes the following arguments: rays Casting rays. blk Volume data in the blocked format. buffer Working buffer. RETURN VALUES
Each of the functions returns MLIB_SUCCESS if successful. Otherwise it returns MLIB_FAILURE. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Interface Stability |Evolving | +-----------------------------+-----------------------------+ |MT-Level |MT-Safe | +-----------------------------+-----------------------------+ SEE ALSO
mlib_VolumeRayCast_General(3MLIB), attributes(5) SunOS 5.10 10 Nov 2004 mlib_VolumeRayCast_Blocked(3MLIB)
All times are GMT -4. The time now is 09:43 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy