Sponsored Content
Top Forums Shell Programming and Scripting perl - reading from a file conditionally Post 302313223 by pludi on Tuesday 5th of May 2009 04:32:47 AM
Old 05-05-2009
Might I suggest using YAML for that. It's structured (just what you need), easier to write (and read) than XML, and you can read configuration directly into Perl structures.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Perl Reading from File

is there a perl equivalent to sscanf? or something where I get the strings separated by spaces? (1 Reply)
Discussion started by: karyn1617
1 Replies

2. UNIX for Dummies Questions & Answers

perl - file reading - last line not displayed

Hi, Here is something that am trying with perl #! /opt/third-party/bin/perl open(fh, "s") || die "unable to open the file <small>"; @ch = (); $i = 0; while( $content = <fh> ) { if( $i <= 5 ) { push(@ch, $content); $i++; } else { $i = 1; foreach(@ch) { (8 Replies)
Discussion started by: matrixmadhan
8 Replies

3. Shell Programming and Scripting

Reading File from Server - perl

Hey, I'm trying to read a file from a server. Simple file with some numbers. Here is the code i'm running. use Net::SSH::Perl::SSH1 ; $scon = Net::SSH::Perl->new ("com123.sever.mydomain.com",(protocol=>'2',port=>'22',debug=>'true')); $scon->login("user123","pass123"); open(FILE,... (9 Replies)
Discussion started by: Phi01
9 Replies

4. Shell Programming and Scripting

Perl: Reading data from other file

Hi, I am writting some perl scripts for daily backup process. In which I want to pass some data/referance from another txt file. Text file contains only one column and multiple rows. I want to pass this data to variables of another perl script. e.g. Refdoc.txt file contains data as: perl1... (3 Replies)
Discussion started by: n.dba
3 Replies

5. Shell Programming and Scripting

Help with perl script while reading a file

Hi Everyone, I am very new to perl, but came across a situation wherein I have to read a c++ header file and write the datatype, its identifier and also the length to an excel file. There can be other header files, in the directory but I should browse through the file which has only "_mef:" string... (9 Replies)
Discussion started by: ramakanth_burra
9 Replies

6. Shell Programming and Scripting

Help need in perl script reading from file

Need perl script, data file will be csv format. I have text file contains 2 colums. Filename Foldernumber aaaa 13455 bbbb 23465 cccc 26689 I have two location 1. files present and 2. folders present. I need to search for file and folder if folder... (3 Replies)
Discussion started by: hnkumar
3 Replies

7. Shell Programming and Scripting

Reading a column from xls file using perl

Hi Everyone! I have a problem in reading a specific column from .xls file using perl language and then manipulating on given criteria. Detailed Description of the problem:: I have one .xls file, in which i have to populate two columns based on Period_date column which is in same file. My... (1 Reply)
Discussion started by: kvth
1 Replies

8. Shell Programming and Scripting

Help with reading a specific portion of a file using PERL

Hello, I am trying to read from a file using PERL:confused, however i need to read specific portions of the file the file goes like this <Name 1 Hono <Name 2 Jack and so on anyways i need to be able to write a program that ONLY opens the lines beginning with "<"? so it would... (2 Replies)
Discussion started by: UNDstudent
2 Replies

9. UNIX for Dummies Questions & Answers

reading a file in Perl

If a form's action is the following Perl script how do I make it print the entire contents of the file on the screen? if(param()) { my $uploadedFile = param('file');#in the html page 'file' is the value of the name attribute of the input my $fh = upload($uploadedFile); ... (1 Reply)
Discussion started by: zerohour
1 Replies

10. Shell Programming and Scripting

Need help with perl script with a while loop reading file

Good morning, I appreciate any assistance that I can get from the monks out there. I am able to get this to work for me so that I can do a hostname lookup if I only specify one hostname in the script. What I want to do is have a file with hostnames and do lookups for each name in the file. Here is... (1 Reply)
Discussion started by: brianjb
1 Replies
jwhois(1)						      General Commands Manual							 jwhois(1)

NAME
jwhois - client for the whois service SYNOPSIS
jwhois [ OPTIONS ]... [ QUERY ] DESCRIPTION
jwhois searches Whois servers for the object on the command line. The host to query is taken from a global configuration file, a configuration file specified on the command line, or selected directly on the command line. OPTIONS
--version display version, authors and licensing information. --help display a short help text. -c FILE --config=FILE uses FILE as a configuration file instead of the default. -h HOST --host=HOST overrides any hosts in the configuration file and queries HOST directly. -p PORT --port=PORT specifies a port number to use when querying a HOST. -f --force-lookup forces a query to be made to a host even if a current object is available from the cache. -v --verbose outputs verbose debugging information while running (use this before sending a bugreport to ensure that it's indeed a bug and not a misconfiguration). You can increase the verbosity by giving several verbose commands to jwhois, such as -vv. -n --no-redirect disable features that redirect queries from one server to another. -s --no-whoisservers disable the built-in support for whois-servers.net. -a --raw send query verbatim to receiving hosts instead of rewriting them according to the configuration. -i --display-redirections display every step in a redirection (default is to display only the last answer). -d --disable-cache completely disable both reading and writing to cache. -r --rwhois force the query to use the rwhois protocol instead of HTTP or whois. --rwhois-display=DISPLAY asks receiving rwhois servers to display the results in the DISPLAY display instead of the default dump display. --rwhois-limit=LIMIT asks receiving rwhois servers to limit their responses to LIMIT matches. RIPE EXTENSIONS To use the options specified in RIPE Document 157, you need to change the format of the query slightly. If you were to search for all entries in the RIPE database which lists the admin-c, tech-c or zone-c as CO19-RIPE, you could use the following command syntax: jwhois -h whois.ripe.net -- -i admin-c,tech-c,zone-c CO19-RIPE -- is used to separate the RIPE options from the jwhois options. SEE ALSO
whois(1) GNU
November 2001 jwhois(1)
All times are GMT -4. The time now is 03:10 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy