09-21-2012
The awk command searches for a record whose first field ($1) matches the variable value supplied (variable what containing ProdId_A). For each such record, the split function is used to get, e.g., 9.9.9 from sometext_9.9.9. This combination (field 2 and the value from the last operation) is stored in the variable a. This is printed at the end of the file to emulate searching the first record from the bottom of the file.
This User Gave Thanks to elixir_sinari For This Post:
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi
How can i dynamically read files names from a list file and execute them from a single shell script.
Please help its urgent
Thanks in Advance (4 Replies)
Discussion started by: anushilrai
4 Replies
2. Shell Programming and Scripting
Can someone please help me to write script for following scenario :
1> script should read a input .csv file of format : EmpName, PF, Leave, Basic ,HRA
2> another config file ( may be again a .csv file ) has format EmpName and EmpID
3> script should read another config file for each EmpName in... (3 Replies)
Discussion started by: creativeworld
3 Replies
3. Shell Programming and Scripting
For reading a file through shell script I am using yhe code :
while read line
do
echo $line
done<data.txt
It reads all the line of that file data.txt.
Content of data.txt looks like:
code=y
sql=y
total no of sql files=4
a.sql
b.sql
c.sql
d.sql
cpp=n
c=y
total no of c files=1 (4 Replies)
Discussion started by: Dip
4 Replies
4. Shell Programming and Scripting
Hi,
Data file named parameter contains :
DB=y
Alter_def.sql
Create_abc.sql
SQL=y
database.sql
my_data.sql
To read this file I use
var_sql=$(awk -F= '$1 == "SQL" { print $2 }' parameter.txt)
if
then
sql_f_name=`grep "\.sql" parameter.txt`
echo $sql_f_name
fi (2 Replies)
Discussion started by: Dip
2 Replies
5. Shell Programming and Scripting
Hi,
I am new to the shell script please I need help for following question.
I have properties file name called "com.test.properties" I have No of key values in this properties.
com.person.name = xyz
com.person.age = 55
com.person.address = hello
I want read this properties but i... (1 Reply)
Discussion started by: venukjs
1 Replies
6. Shell Programming and Scripting
Hello,
I am working on building a script that does the below actions together in my Linux server.
1) First, have to read the list of strings mentioned in CSV and store it in the shell script
2) Second, pick one by one from the string list, and search a particular folder for files that... (2 Replies)
Discussion started by: vikrams
2 Replies
7. Shell Programming and Scripting
Hi!
i need a script that can read a property file.
i.e., A script to read a "property" from property file.
Read the property value and
based on value of property, decide whether to start the some dataload activity or not.
Its urngent. Can anyone help me out???:( (7 Replies)
Discussion started by: sukhdip
7 Replies
8. Shell Programming and Scripting
Hi,
I am tryng to read from a csv file and based on some grep command output I will modify one of the column in the same csv.
Example:-
Input CSV:-
20120829001415,noneAA,google.com
20120829001415,dfsafds,google.com
20120829001415,noneAA,google.com
Intermediate Step:- If 2nd column of... (3 Replies)
Discussion started by: kmajumder
3 Replies
9. UNIX for Dummies Questions & Answers
I need to write a C-Shell script with these properties: It should accept two arguments on the command line. The first argument is the name of a file which contains a list of names, and the second argument is the name of a directory. For each file in the directory, the script should print the... (1 Reply)
Discussion started by: cerce
1 Replies
10. Shell Programming and Scripting
Hello Unix Shell Script Experts,
I have a script that would mask the columns in .csv file or .txt file.
First the script will untar the .zip files from Archive folder and processes into work folder and finally pushes the masked .csv files into Feed folder.
Two parameters are passed
... (5 Replies)
Discussion started by: Mahesh G
5 Replies
LEARN ABOUT DEBIAN
text::csv::encoded::coder::encodeguess
Text::CSV::Encoded::Coder::EncodeGuess(3pm) User Contributed Perl Documentation Text::CSV::Encoded::Coder::EncodeGuess(3pm)
NAME
Text::CSV::Encoded::Coder::EncodeGuess - Text::CSV::Encoded coder class using Encode::Guess
SYNOPSIS
use Text::CSV::Encoded coder_class => 'Text::CSV::Encoded::Coder::EncodeGuess';
use Spreadsheet::ParseExcel;
my $csv = Text::CSV::Encoded->new();
$csv->encoding( ['ucs2', 'ascii'] ); # guessing ucs2 or ascii?
$csv->encoding_to_combine('shiftjis');
my $excel = Spreadsheet::ParseExcel::Workbook->Parse( $file );
my $sheet = $excel->{Worksheet}->[0];
for my $row ( $sheet->{MinRow} .. $sheet->{MaxRow} ) {
my @fields;
for my $col ( $sheet->{MinCol} .. $sheet->{MaxCol} ) {
my $cell = $sheet->{Cells}[$row][$col];
push @fields, $cell->{Val};
}
$csv->combine( @fields ) or die;
print $csv->string, "
";
}
DESCRIPTION
This module is inherited from Text::CSV::Encoded::Coder::Encode.
USE
Except for 2 attributes, same as Text::CSV::Encoded::Coder::Encode.
encoding_in
$csv = $csv->encoding_in( $encoding_list_ref );
The accessor to an encoding for pre-parsing CSV strings. If no encoding is given, returns current $encoding, otherwise the object itself.
$encoding_list_ref = $csv->encoding_in()
When you pass a list reference, it might guess the encoding from the given list.
$csv->encoding_in( ['shiftjis', 'euc-jp', 'iso-20022-jp'] );
If it cannot guess the encoding, the first encoding of the list is used.
encoding
$csv = $csv->encoding( $encoding_list_ref );
$encoding_list_ref = $csv->encoding();
You can pass a list reference to this attribute only:
* For list data consumed by combine().
* For list reference returned by getline().
In other word, in "combine" and "print", it might guess an encoding for the passing list data. If it cannot guess the encoding, the first
encoding of the list is used.
SEE ALSO
Encode, Encode::Guess
AUTHOR
Makamaka Hannyaharamitu, <makamaka[at]cpan.org>
COPYRIGHT AND LICENSE
Copyright 2008-2010 by Makamaka Hannyaharamitu
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
perl v5.14.2 2010-04-26 Text::CSV::Encoded::Coder::EncodeGuess(3pm)