Sponsored Content
Top Forums Shell Programming and Scripting Extract multiple values into corresponding variables Post 302995514 by kchinnam on Thursday 6th of April 2017 04:41:40 PM
Old 04-06-2017
That is awesome.. works great.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Error in fetching multiple row values into variables

Hello Team, In the below code....The variabe values are not fetch from input table into SELECT statements. =========================== #!/usr/bash DATABASE=XXXXX inputFILE=$1 db2 connect to $DATABASE TABLENAME=`echo $inputFILE|awk '{print $1}'` COLUMNNAME=`echo $inputFILE|awk... (2 Replies)
Discussion started by: rocking77
2 Replies

2. Shell Programming and Scripting

Extract multiple values from a tnsping output

Hi all, Can anyone help with the following request? I need to extract HOST value, SERVICE_NAME and msec value from a tnsping output and append to a file. The tnsping output is typically as follows: Used TNSNAMES adapter to resolve the alias Attempting to contact (DESCRIPTION = (ADDRESS =... (4 Replies)
Discussion started by: jonnyd
4 Replies

3. Shell Programming and Scripting

Running a script with multiple variables like 25 variables.

Hi All, i have a requirement where i have to run a script with at least 25 arguements and position of arguements can also change. the unapropriate way is like below. can we achieve this in more good and precise way?? #!/bin/ksh ##script is sample.ksh age=$1 gender=$2 class=$3 . . .... (3 Replies)
Discussion started by: Lakshman_Gupta
3 Replies

4. Shell Programming and Scripting

[Solved] Counting The Number of Lines Between Values with Multiple Variables

Hey everyone, I have a bunch of lines with values in field 4 that I am interested in. If these values are between 1 and 3 I want it to count all these values to all be counted together and then have the computer print out LOW and the number of lines with those values in between 1 and 3,... (2 Replies)
Discussion started by: VagabondGold
2 Replies

5. Shell Programming and Scripting

Read record from the text file contain multiple separated values & assign those values to variables

I have a file containing multiple values, some of them are pipe separated which are to be read as separate values and some of them are single value all are these need to store in variables. I need to read this file which is an input to my script Config.txt file name, first path, second... (7 Replies)
Discussion started by: ketanraut
7 Replies

6. Shell Programming and Scripting

Reading multiple values from multiple lines and columns and setting them to unique variables.

Hello, I would like to ask for help with csh script. An example of an input in .txt file is below, the number of lines varies from file to file and I have 2 or 3 columns with values. I would like to read all the values (probably one by one) and set them to independent unique variables that... (7 Replies)
Discussion started by: FMMOLA
7 Replies

7. Shell Programming and Scripting

Assigning multiple column's value from Oracle query to multiple variables in UNIX

Hi All, I need to read values of 10 columns from oracle query and assign the same to 10 unix variables. The query will return only one record(row). I tried to append all these columns using a delimiter(;) in the select query and assign the same to a single variable(V) in unix. I thought I... (3 Replies)
Discussion started by: hkrishnan91
3 Replies

8. UNIX for Dummies Questions & Answers

Read in Multiple log files and output selected variables and values to cvs file

I have several problems with my problems: I hope you can help me. 1) the If else statement I am getting an error message. My syntax must be incorrect because the entire statement is throwing an error. For example in filew.log if these items don't exist Memsize, SASFoundation and also if... (0 Replies)
Discussion started by: dellanicholson
0 Replies

9. Shell Programming and Scripting

awk to extract multiple values from file and add two additional fields

In the attached file I am trying to use awk to extract multiple values and create the tab-delimited desired output. In the output R_Index is a the sequential # and Pre_Enrichment is defaulted to .. I can extract from the values to the side of the keywords, but most are above and I can not... (2 Replies)
Discussion started by: cmccabe
2 Replies

10. Shell Programming and Scripting

Enhance existing script: Extract Multiple variables & Input in an echo string

Hi Experts I need your help to optimize my script to execute better as I have nearly 1M records & the script is taking close to 40 minutes to execute, so would need support on a faster alternative. Input: file {"house":"1024","zip":"2345","city":"asd","country":"zzv"}... (2 Replies)
Discussion started by: nk1984
2 Replies
Config::INI::Reader(3pm)				User Contributed Perl Documentation				  Config::INI::Reader(3pm)

NAME
Config::INI::Reader - a subclassable .ini-file parser VERSION
version 0.019 SYNOPSIS
If family.ini contains: admin = rjbs [rjbs] awesome = yes height = 5' 10" [mj] awesome = totally height = 23" Then when your program contains: my $hash = Config::INI::Reader->read_file('family.ini'); $hash will contain: { '_' => { admin => 'rjbs' }, rjbs => { awesome => 'yes', height => q{5' 10"}, }, mj => { awesome => 'totally', height => '23"', }, } DESCRIPTION
Config::INI::Reader is yet another config module implementing yet another slightly different take on the undeniably easy to read ".ini" file format. Its default behavior is quite similar to that of Config::Tiny, on which it is based. The chief difference is that Config::INI::Reader is designed to be subclassed to allow for side-effects and self-reconfiguration to occur during the course of reading its input. METHODS FOR READING CONFIG
These methods are all that most users will need: they read configuration from a source of input, then they return the data extracted from that input. There are three reader methods, "read_string", "read_file", and "read_handle". The first two are implemented in terms of the third. It iterates over lines in a file, calling methods on the reader when events occur. Those events are detailed below in the "METHODS FOR SUBCLASSING" section. All of the reader methods return an unblessed reference to a hash. All throw an exception when they encounter an error. read_file my $hash_ref = Config::INI::Reader->read_file($filename); Given a filename, this method returns a hashref of the contents of that file. read_string my $hash_ref = Config::INI::Reader->read_string($string); Given a string, this method returns a hashref of the contents of that string. read_handle my $hash_ref = Config::INI::Reader->read_handle($io_handle); Given an IO::Handle, this method returns a hashref of the contents of that handle. METHODS FOR SUBCLASSING
These are the methods you need to understand and possibly change when subclassing Config::INI::Reader to handle a different format of input. current_section my $section_name = $reader->current_section; This method returns the name of the current section. If no section has yet been set, it returns the result of calling the "starting_section" method. parse_section_header my $name = $reader->parse_section_header($line); Given a line of input, this method decides whether the line is a section-change declaration. If it is, it returns the name of the section to which to change. If the line is not a section-change, the method returns false. change_section $reader->change_section($section_name); This method is called whenever a section change occurs in the file. The default implementation is to change the current section into which data is being read and to initialize that section to an empty hashref. parse_value_assignment my ($name, $value) = $reader->parse_value_assignment($line); Given a line of input, this method decides whether the line is a property value assignment. If it is, it returns the name of the property and the value being assigned to it. If the line is not a property assignment, the method returns false. set_value $reader->set_value($name, $value); This method is called whenever an assignment occurs in the file. The default behavior is to change the value of the named property to the given value. starting_section my $section = Config::INI::Reader->starting_section; This method returns the name of the starting section. The default is: "_" can_ignore do_nothing if $reader->can_ignore($line) This method returns true if the given line of input is safe to ignore. The default implementation ignores lines that contain only whitespace or comments. preprocess_line $reader->preprocess_line($line); This method is called to preprocess each line after it's read but before it's parsed. The default implementation just strips inline comments. Alterations to the line are made in place. handle_unparsed_line $reader->handle_unparsed_line( $io, $line ); This method is called when the reader encounters a line that doesn't look like anything it recognizes. By default, it throws an exception. finalize $reader->finalize; This method is called when the reader has finished reading in every line of the file. new my $reader = Config::INI::Reader->new; This method returns a new reader. This generally does not need to be called by anything but the various "read_*" methods, which create a reader object only ephemerally. ORIGIN
Originaly derived from Config::Tiny, by Adam Kennedy. AUTHOR
Ricardo Signes <rjbs@cpan.org> COPYRIGHT AND LICENSE
This software is copyright (c) 2007 by Ricardo Signes. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. perl v5.14.2 2011-12-15 Config::INI::Reader(3pm)
All times are GMT -4. The time now is 11:09 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy