Perl parsing help required.


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users Perl parsing help required.
# 8  
Old 02-05-2012
Thank you very much..
Tell me one thing is the array is automatically shifted when new value come between then.
Like suppose
a[0]=1
a[1]=2
a[2]=3
a[3]=4
a[4]=5

through code the new value is inserted to 2 index of array now it becomes

a[0]=1
a[1]=2
a[2]=12
a[3]=3
a[4]=4
a[5]=5

Is that correct...
# 9  
Old 02-05-2012
No. That will never happen. The existing element is concatenated with a new string.
For e.g, if a[0] initially had 1 and you do this: a[0] .= 0, then a[0] would now contain 10.
This User Gave Thanks to balajesuri For This Post:
# 10  
Old 02-05-2012
[QUOTE=balajesuri;302595767]No. That will never happen. The existing element is concatenated with a new string.
For e.g, if a[0] initially had 1 and you do this: a[0] .= 0, then a[0] would no


Thanks Guru
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Xsltproc showing error in parsing xml...help required

I need to parse text between xml tags using xsltproc. It seems the easiest way. Here the Input file looks like <?xml version="1.0" ?> - <tag:ROOT xmlns:as="http://some.org/some.xsd" xmlns:tag="http://www.tag.org/schemas" xmlns:xs="http://some.org/"> - <tag:L1> - <tag:L2> - <tag:L3> ... (2 Replies)
Discussion started by: alpha_1
2 Replies

2. Shell Programming and Scripting

Perl script required for processing the data

I have following result.log file (always has 2 lines) which I need to process, cat result.log name.cmd.method,"result","abc","xyz"; name="hello,mine.12345,"&"tree"&" xyz "&" tree "&" xyz", data="way,"&" 1"&"rate-me"&"1"&"rate-me",str="",ret=""; now I need to extract the strings/data as... (4 Replies)
Discussion started by: perlDiva
4 Replies

3. Shell Programming and Scripting

PERL: Help required exact match

Hello, My requirement is to iterate over all the lines of a file and compare them with a word and perform some operations if exact match is found. For the snippet below, it works even if contents of line include "diff" and "diff:". I want it to work only if it is exactly "diff" and is not... (2 Replies)
Discussion started by: sarbjit
2 Replies

4. Shell Programming and Scripting

Help required in parsing a csv file

Hi Members, I am stuck with the following problem. Request your kind help I have an csv file which contains, 1 header record, data records and 1 footer record. Sample is as below Contents of cm_update_file_101010.csv -------------------------------------------------- ... (6 Replies)
Discussion started by: ramakanth_burra
6 Replies

5. Shell Programming and Scripting

Parsing information in perl

So i'm trying to write a perl script that logins into a network switch via ssh: #sh ip traffic IP statistics: Rcvd: 1460119147 total, 563943377 local destination 0 format errors, 0 checksum errors, 48401998 bad hop count 0 unknown protocol, 8379279 not a gateway ... (2 Replies)
Discussion started by: streetfighter2
2 Replies

6. Shell Programming and Scripting

perl required output

Hi, I have a string in log file from that i need to pick the username. the string is like this-- pid 2172 tid 3124: 160: 10110847: userName : pid 2172 tid 3124: 160: 10110847: userName : pid 2172 tid 3124: 160: 10110847: userName : pid 2172 tid 3124: 160: 10110847: userName : pid... (5 Replies)
Discussion started by: namishtiwari
5 Replies

7. UNIX for Advanced & Expert Users

Perl - Help required

I am trying to upload a file to a SQL database table. The column type is IMAGE. I am looking for a solution to upload a word doc file. I tried 3 approaches. 1) my $fileToStore = "mytest.doc"; open IPFILE, "<", $name; binmode IPFILE; while (<IPFILE>) { $fileToStore .= $_; } close IPFILE;... (1 Reply)
Discussion started by: b.paramanatti
1 Replies

8. Shell Programming and Scripting

Perl Script required...

Hi All, Windows Platform. Perl Scripting. I have a file called 'hostnames.txt' contains hostname entries one by one line. Script has to perform the following command for each entry in that file. ovtopofix -G <hostname> Please anybody give me the script on this requirement. Thanks,... (1 Reply)
Discussion started by: ntgobinath
1 Replies

9. Shell Programming and Scripting

Perl parsing compared to Ksh parsing

#! /usr/local/bin/perl -w $ip = "$ARGV"; $rw = "$ARGV"; $snmpg = "/usr/local/bin/snmpbulkget -v2c -Cn1 -Cn2 -Os -c $rw"; $snmpw = "/usr/local/bin/snmpwalk -Os -c $rw"; $syst=`$snmpg $ip system sysName sysObjectID`; sysDescr.0 = STRING: Cisco Internetwork Operating System Software... (1 Reply)
Discussion started by: popeye
1 Replies

10. Shell Programming and Scripting

perl help required

hi previously this program used to ask for user input to perform operation so i have done the modifications but problem is that i have to create new file and redirect that file as input to this file and i want to avoid that so i made following modifications in program and i am not sure if its... (1 Reply)
Discussion started by: zedex
1 Replies
Login or Register to Ask a Question