196 Posted Topics

Member Avatar for red711

Hi Alexei, As you saw on this thread. This particular question was solved 3 years ago. You should start a new thread where others could see your question clearly and be able to help you out.

Member Avatar for 2teez
1
560
Member Avatar for Jack_9
Member Avatar for Jack_9

If you are starting out, you can use **Learning Perl**, but if you already have a working understanding of Programming and a bit of Perl you can get Chromatic free e-book **Modern Perl** 2014 Edition. There is also a very recent Perl book by Ovid called **Beginning Perl**, very good …

Member Avatar for 2teez
0
122
Member Avatar for Needhelp2

Normally, you will probably want to use a database for such a large file, in my opinion that would be more effective, especailly for a data as large as that. But of course there are several other factors that can work in our favour otherwise. That being said, I think …

Member Avatar for Needhelp2
0
3K
Member Avatar for abaddon2031

In the spirit of more than one way to do it, you can also do this: for i in '20140702_PAQT_B6h'.split('_'): if i.startswith('P'): print (i) elif i.startswith('B'): print (i) **Output** will be like: PAQT B6h Note however, that you can use this if you are actually reading from a file, you …

Member Avatar for snippsat
0
269
Member Avatar for abeer araji

I will agree with *JeffGrigg* here. At least show what you have been able to do. Where you are having problems. Am sure with the solution already posted you should be able to adapt to your own code.

Member Avatar for stultuske
-1
176
Member Avatar for rama.krishna.9003

Hi, In solivng this type of problems, you have to open your two files, read from the second one and take the first two column as key/value for an hash. Then open the first file and read line by line and check if the last column is the same as …

Member Avatar for Dani
0
1K
Member Avatar for Anna123

Hi anni, Using the code you posted, I can't reproduce your output. Since the dataset you posted had no tab in it, at least from the forum. However, using an algothrium similar to yours, I could produce what you wanted, I suppose given that your desired output is not displayed …

Member Avatar for Anna123
-1
232
Member Avatar for Anna123

hello Anna123, As much as I would like to help, I really don't see a correclation between the sample of the files you have posted. Or am I missing something? Please, could you described or give more or better data sample and tell what you are trying to **match**. That …

Member Avatar for Anna123
0
425
Member Avatar for FelineHazard

hi, >Can anyone explain to me what I am doing wrong? (Or how to correctly return values from the subroutine?) What you are doing wrong is that: 1. You are not subclassing HTML::Parser, so if you run your code like you gave it what you are suppose to see is …

Member Avatar for FelineHazard
0
391
Member Avatar for Anna123

hello Anna123, As much as I would like to help, I really don't see a correclation between the sample of the files you have posted. Or am I missing something? Please, could you described or give more or better data sample and tell what you are trying to match. That …

Member Avatar for Anna123
0
228
Member Avatar for vivek.vivek

Hi, How would you write this yourself. i will show one of the ways by which this could be written. How to display the result is left for the OP as an execricse. use warnings; use strict; use Data::Dumper; my %data; my $key; while (<DATA>) { if (/User.+?(\S+):/) { $key …

Member Avatar for 2teez
0
176
Member Avatar for narendra75

Yes. There is GUI in perl. But there are certain things you should know before getting into GUI in perl like Scalar type, array and hash. References and Object-oriented programming. You however need have module like perl/Tk installed on your system. Check [Tk](http://search.cpan.org/~ni-s/Tk-804.027/pod/UserGuide.pod)

Member Avatar for 2teez
0
98
Member Avatar for mcsreerag

Hi [mcsreerag], > What shall I do? The question is What have you done? Show us some honest effort on your part and the areas you having problems with, then am sure someone will surely come up with a sound solution. Meanwhile, if you are on *nix* system you can …

Member Avatar for naveen1993
0
162
Member Avatar for hasvi

Hi hasvi, > I need how to call xml file, in the above script. Please help me. How do you mean call xml file? Please don't try to parse xml file using regex, you can use modules on metaCPAN or CPAN such as [XML::Simple](https://metacpan.org/pod/XML::Simple) for what you are trying to …

Member Avatar for class11a
0
233
Member Avatar for Hari_8

Hi, Maybe the OP wanted something like so: use warnings; use strict; my $sep = qr/-/; my $xml = qq[<opt_cisco>\n]; while (<DATA>) { next if /^$/; chomp; my ( $tag, $content ) = split /$sep/, $_, 2; $xml .= qq[<$tag>$content</$tag>\n]; } print $xml, qq[</opt_cisco>\n]; __DATA__ client1-10.1.1.1/24 clientgw1-10.1.1.2 server1-10.1.1.3/24 servergw1-10.1.1.4 client2-10.1.2.1/24 …

Member Avatar for 2teez
0
212
Member Avatar for xyciana

Hi xyciana, This answer might be coming a bit late, but am sure it will be useful. Using the data you posted, you can simply use `XML::Simple` as you are doing with `Text::CSV` or you use a better xml parser like `XML::LibXML`. Yes, `XML::Simple` can simply take on your dataset …

Member Avatar for 2teez
0
953
Member Avatar for magikman

Hi magikman, Going through your post, I think you are either asking two different questions or the first question is a sub-set of the second one. The first question on it own as stated: >I am trying to write a Perl script that searches through a directory on Windows and …

Member Avatar for 2teez
0
351
Member Avatar for newperluser

Hi newperluser, > I am new to Perl You are welcome to using Perl, a great programming language and tool. It would have been wonderful, if you have shown what you have been able to do yourself, then you can get help and correction. However, I observed that your data …

Member Avatar for 2teez
0
144
Member Avatar for gg_bata

And how would you do it? You will need proto make an effort here, then you will get help from others. Helping you with your project or assignment does not include doing them for you. Is that not?

Member Avatar for Schol-R-LEA
0
174
Member Avatar for vineeth.shankar1

Hi vineeth.shankar1, >My problem is, how to compare user name with the name of the file How are you doing it? Please check the documentation and usage of `strcmp` like so `man strcmp` on *nix* systems.

Member Avatar for Ancient Dragon
0
108
Member Avatar for mohit_c

hi [mohit c] > I am unable to understand why 10 in the last line is printed. Please help... Your input file has a blanck line (new line) after the the line `12sdfsldkfj` i.e if the line of your input is `1`, the blanck line is `2` remove it and …

Member Avatar for Ancient Dragon
0
228
Member Avatar for Mohammed_9

> Is this correct? No, Not in the way you are doing it. There are several stuff missing in your code. Like in your format used in the `scanf`. Moreso, you might want to use `fgets` instead. @Ancient Dragon: > You can't nest one function inside another. I think it …

Member Avatar for 2teez
0
249
Member Avatar for nitish.mohiputlall

Hi, > here is the original codes that has been set in the question paper Is it permitted in your school to share and ask for help on a question paper, that is not an assignment?

Member Avatar for David W
-1
140
Member Avatar for nitish.mohiputlall

Hi [nitish.mohiputlall], When I compiled and run the first code you gave. All the element in the array were all initialized to `0`. All that were displayed on the CLI. But while using the second set of codes because of `(ptr=ptr+2)` all the odd element of the array weren't initialized …

Member Avatar for 2teez
0
537
Member Avatar for glao

>I want this printf("\n%d \n",test(&a[i])); to work. What do you think line 13 is doing? Or what do you hope to achieve with it? Then check what you passing to the test function.

Member Avatar for Banfa
0
211
Member Avatar for yann.bohbot.9

Hi yann.bohbot.9, >*I'm just trying to scan an array using a pointer but when i print it it shows me only zeros. Any help?* first, your main function has a return type of `int` yet doesn't return any, as though you have declare it with return type `void`. Secondly, though, …

Member Avatar for sepp2k
0
129
Member Avatar for realoneomer

Hi realoneomer, It's good to always give a trial on something, even when someone is new to such and then ask for help, expect you are really to pay for the services you are asking for. But let me assume you are totally new on perl. I would give you …

Member Avatar for 2teez
0
164
Member Avatar for giovanni.arrastia

In addition to what as been said here. Maybe you could start with following documentation right from on top of your system, it will cost you nothing but time. Just type the following on the CLI `perldoc perlrequick`, for a quick start. Then a bit longer one `perldoc perlretut`. You …

Member Avatar for 2teez
0
167
Member Avatar for soundbag

You might what to use `defined` in perl. Please check [defined](http://perldoc.perl.org/functions/defined.html)

Member Avatar for 2teez
0
68
Member Avatar for fiju

Hi, Use `cpanm` to install the module and it's dependencies. See [cpanm](https://metacpan.org/pod/release/MIYAGAWA/App-cpanminus-1.7001/bin/cpanm)

Member Avatar for 2teez
0
175
Member Avatar for karma2you

Hi, I think you will do yourself a lot of good if you really understand data types in C. So that you don't confused `char` data type with `integer` data type. Then also note that in C, *string* is just `char` array. So understanding array is key. **gerard4143** raised a …

Member Avatar for Ancient Dragon
0
245
Member Avatar for iness.popovcic
Member Avatar for Pratique
Member Avatar for Mouche
0
349
Member Avatar for cpfevr692590

Hi, Is either you are working with *MaddTechwf* or you are the same person with a different username. Like I mentioned on his trends which is marked solved, there are better way of doing what he wants. Moreover, except I don't understand his requirement, how are you getting your straight …

Member Avatar for 2teez
0
1K
Member Avatar for MikeTr

Try using [WWW::Mechanize](https://metacpan.org/pod/WWW::Mechanize). It a lot better.

Member Avatar for MikeTr
0
729
Member Avatar for MaddTechwf

Hi MaddTechwf, Please don't comment out `use strict;` from your script. It helps a great deal. Fine, you have what you wanted. But am sure there are several ways of doing what you wanted, even better, I suppose. There are several codes here one can improve on. But since you …

Member Avatar for 2teez
0
259
Member Avatar for newbie14

Hi, Please can you check the usage of `sprintf` using `man sprintf` if you are using a *nix OS*. I don't think, you are using it rightly.

Member Avatar for newbie14
0
295
Member Avatar for hema_24

Hi hema_24, One way of solving this kind of problem is like this: Make an hash and get the data from your condition_files, and then read from the other files onces at a time. Since, the first two columns seerated by commas are what is needed for comparism. One can …

Member Avatar for 2teez
0
212
Member Avatar for perlbegginer02

Hello perlbegginer02, This sound to me like an assignment. However, if you ask for help atleast you are suppose to show some effort on your part. The Gettysburg Address you didn't post and there was no script whatsoever. I will give show how to solve this but you will have …

Member Avatar for 2teez
0
166
Member Avatar for Bhavya scripted

Hi Bhavya scripted, Welcome to daniweb and to the world of all possibility, I mean Perl Programming Language. You might probably want to check this [Perl Binaries for Windows](http://www.perl.org/get.html#win32)

Member Avatar for Bhavya scripted
0
189
Member Avatar for preeti_2

Hi preeti2, You can do the following: Since split function uses regex, you can split on or OR and OR ( OR ) and space, then print out your result as you desire like thus: use warnings; use strict; my $reg = qr/ or | and |\s+\(|\)\s+|\s+/; while (<DATA>) { …

Member Avatar for 2teez
0
128
Member Avatar for genetist

Hi genetist, There are several things in the your explination of the what you want that is not clear. However, following the title of your post and with a little understanding of what you wanted I came up with the following that I believe will help you a great deal. …

Member Avatar for 2teez
0
161
Member Avatar for perly

Hi Perly, In your code, variable **$col12** is not defined. Check it. Moreover, you don't have to do it this way. You can try this: use strict; use warnings; while (<DATA>) { for my $value ( ( split /\s+/, $_ )[ 2 .. 13 ] ) { print $_ and …

Member Avatar for perly
0
253
Member Avatar for Garidius

It would have been wonderful if you give an example of what you are trying to achieve. However, you could check if this link can help.[Using regexp with binary data](http://www.perlmonks.org/?node_id=487261)

Member Avatar for Garidius
0
132
Member Avatar for leghorn

Hello leghorn, Good morning, If I may comment on your Perl script. $resFile = &getFileName($ARGV[0]); $fileType = &getFileType($ARGV[0]); You don't need the '&' in front of your subroutrine in this case. Though '&' is optional for perl subroutine or function as other programming language calls it. What does those mean? …

Member Avatar for leghorn
0
262
Member Avatar for johnyc

Hi, It easily done, but you are going about it the wrong way. In the first place you don't need Spreadsheet::ParseExcel since you are not parsing excel sheets. Then again why read into an array, only to empty it again. Lastly, you are going over each file and make a …

Member Avatar for 2teez
0
2K
Member Avatar for danielsikes

Hi, How do you mean? > detect when a field is focused in an external program? Please explain more what you intend doing.

Member Avatar for 2teez
0
131
Member Avatar for salem_1

Hi salem_1, Actually, if you check in the this forum am sure what you intended have been done again and again. You can check this for example [file comparism in Perl](http://www.daniweb.com/software-development/perl/threads/445920/file-comparision-in-perl) You can modify these solution to suit your requirement. Hoe this helps

Member Avatar for 2teez
0
273
Member Avatar for anglaissam

Hi anglaissam, Foremost, please use 'warnings' and 'strict' in your script, it will have in a million ways; talking from experience. Secondly, don't program in a cage!!! What do I mean? use what has been provided in the program. Instead of doing the job all by yourself. For example in …

Member Avatar for anglaissam
0
198

The End.