I have a file that i want to split out into a hash, but the delimiter is either a space or a comma but the last column needs to be able to include spaces ..
so for example my file
which I split out using into a hash by doing the following
but the problem is, because I have split() using commas and spaces, when it comes to the last value I want to capture, its pulling "Accounts" into the hash instead of "Accounts Team".
unfortunately I am unable to change the source file, but does anyone know how I can split using spaces and commas except for the last column ? (which incedentally will always be the 6th and last value in the file)
$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";
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... (5 Replies)
I am interested in 2 and 36th fields in this input file. I was wondering if there was a more efficeint way to do this.
($pt1,$bkup_name,$pt3,$pt4,$pt5,$pt6,$pt7,$pt8,$pt9,
$pt10,$pt11,$pt12,$pt13,$pt14,$pt15,$pt16,$pt17,
... (7 Replies)
Hi,
I have to split a line of the form
1232423#asdf#124324#54534#dcfg#wert#rrftt#4567
into an array in perl. I am using
@fields;
@fields=split('#',$line);
if($fields eq "1")
But this is not working. By using the syntax, the statements in "if" are never executed. Please help.... (9 Replies)
hi, I have a seemingly really stupid question, but here goes!
What do you enter into split delimiter to seperate something like this
"December 12, 1995"
and get
December
12
1995
?
thanks (5 Replies)
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)
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)
Hi,
I have tried the split and join functions but stuck with unexpected results. Any help appreciated. I pass multiple values at command line like perl test.pl -type java,xml. This works good for me but i am not sure how to print it in the required format.
Here is the code i tried:... (4 Replies)
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)
Hi,
I need your help for below with shell scripting or perl
I/P
key, Sentence
customer1, I am David
customer2, I am Taylor
O/P
Key, Words
Customer1,I
Customer1,am
Customer1,David
Customer2,I
Customer2,am
Customer2,Taylor (4 Replies)
Discussion started by: monishathampi
4 Replies
LEARN ABOUT HPUX
clone
clone(7) Miscellaneous Information Manual clone(7)NAME
clone - opens a major and minor device pair on a STREAMS driver
DESCRIPTION
The driver is a "pass through" device driver that allows other drivers to select unique minor device numbers on each In effect, the driver
passes an open operation through to the other driver. This mechanism allows for multiple instantiations of a driver, each with a different
minor number, through a single device file.
When the driver is opened, it is passed a major and minor device number by the operating system. The major number is the driver's major
number (72), and the minor number is the major number of the driver the user wishes to clone (referred to here as the target driver). The
driver calls the open routine of the target driver with the flag which specifies a clone open. The target driver's open routine allocates
an unused minor number. The target driver must use to make a new device number for the newly created device, and must set to the new
device number returned by The new device number is returned to the open through The open then returns to the user a file descriptor that
points to the new instantiation of the target driver.
The driver is an example of a clonable driver.
Notes
It is not possible to do multiple opens of a device with the same major and minor number using the driver. This is because the driver is
only given the major number of the driver to be cloned, and that driver will then select a minor number which has not been opened.
When called with a pathname which corresponds to the clonable driver, will return different results than when it is called on a file
descriptor returned from of the same clonable driver pathname.
RETURN VALUES
If the driver is given an invalid minor number, or if the driver indicated is not a clonable driver, the fails and is set to [ENXIO].
SEE ALSO open(2), fstat(2).
clone(7)