10-29-2011
cut the variable from the line and use it to find the file and read the content of that file
Hi,
I am working on one script..I am having files in the below format
file 1 (each line is separated with : delimeter)
SPLASH:SPLASH:SVN
CIB/MCH:MCH:SVN
Now I want from file 1 that most left part of the first line will store in one variable...i.e in the below way
a=SPLASH
b=SPLASH
c=SVN
a=CIB/MCH
b=MCH
c=SVN
and there is one folder which is having number of files that will start with the second varible of each line of file1
like TEST is a folder which is having
SPLASH_release.txt
MCH_release.txt
Now I want when second variable store in b like above example I want to use that variable to find that file in TEST folder and will read the content of that file.
these SPLASH_release.txt files always keep single line like SPLASH_11_26_00_RC01
Please help me on this.
Thanks,
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hi all,
I'm quite new to unix and hope that someone can help me on this.
I'm using csh.
Below is what i intend to do.
1. I stored some data in a file.
2. I intend to read the file line by line and store each line of data into a variable, so that i can used it later.
Anyone have any... (4 Replies)
Discussion started by: seijihiko
4 Replies
2. Shell Programming and Scripting
Hi Experts.
I need to list the file and the filename comes from the file ListOfFile.txt.
Basicly I have a filename "ListOfFile.txt" and it contain
Example of ListOfFile.txt
/home/Dave/Program/Tran1.P
/home/Dave/Program/Tran2.P
/home/Dave/Program/Tran3.P
/home/Dave/Program/Tran4.P... (7 Replies)
Discussion started by: tanit
7 Replies
3. Shell Programming and Scripting
Hi,
I have gps receiver log..its giving readings .like below
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
GPSD,R=1
$GPGSV,3,1,11,08,16,328,40,11,36,127,00,28,33,283,39,20,11,165,00*71... (3 Replies)
Discussion started by: gudivada213
3 Replies
4. Shell Programming and Scripting
Friends,
I have a file output.txt with values as below:
092307135717
061910135717
I want to know how to read this file and then assign each value to a variable.
say like
var1=092307135717
var2=061910135717
So that I can use this VAR1 and Var2 in the shell script for further processing.... (3 Replies)
Discussion started by: shyamaladevi
3 Replies
5. Shell Programming and Scripting
Hello, I am quite new in shell scripting and I would like to write a little scritp to run a program on some parameters files.
all my parameters files are in the same directory, so pick them up with
ls *.para >>dirafter that I have a dir file like that:
param1.para
param2.para
etc...
I... (2 Replies)
Discussion started by: shadok
2 Replies
6. Shell Programming and Scripting
I need to read temp.$i file content line by line through while loop but somehow the '\' do not appear in output.. Can someone guide how to read this exact content line by line in unix :
if
then
cat temp.$i | head -1 # the file content appears fine
while... (13 Replies)
Discussion started by: Prev
13 Replies
7. Shell Programming and Scripting
Hello,
I am using below code for reading from a file and assigning the values to a variable , but it is loosing the value after the loop , please suggest to retain the value of the variable after the loop ,
while IFS=: read -r line
do
set $dsc=$line
echo 'printing line variable ' $line... (1 Reply)
Discussion started by: ParthThakkar
1 Replies
8. Shell Programming and Scripting
I have a variable and assigned the following values
***XYZ_201519_20150929140642_20150929140644_211_0_0_211
I need to read this variable from backward and stop read when I get first underscore (_)
In this scenario I should get 211
Thanks
Kris (3 Replies)
Discussion started by: mkris
3 Replies
9. Shell Programming and Scripting
Hi all,
i need a bash script.
I have a 3 file named Milano, Torino, Firenze
Into file i have:
Milano
Marco
Luca
Giorgio
Michele
PatrizioTorino
Marco
Giulio
Emilio
MicheleFirenze
Luca
Giorgio
Marco
Saverio
EmilioThe output should be a all_city.csv file like: (3 Replies)
Discussion started by: kamose
3 Replies
10. Shell Programming and Scripting
Hello All,
While searching for the question, I found some answers but my implementation is not giving expected output.
I have two files; one is sourcefile, other is named template.
What I want to do is to search each line in template, when found all columns, cut the matching line from source... (4 Replies)
Discussion started by: baris35
4 Replies
LEARN ABOUT DEBIAN
svn::web::i18n
SVN::Web::I18N(3pm) User Contributed Perl Documentation SVN::Web::I18N(3pm)
NAME
SVN::Web::I18N - SVN::Web internationalisation class
SYNOPSIS
use SVN::Web::I18N; # Nothing exported
# Add a directory that contains .po and/or .mo files
SVN::Web::I18N::add_directory('/path/to/directory');
# Specify the current language
SVN::Web::I18N::loc_lang('en');
# Get a translated string
my $xlated = SVN::Web::I18N::loc('(a string to translate)');
DESCRIPTION
SVN::Web::I18N provides the interface through which SVN::Web is internationalised, and how different localisations are implemented.
SUBROUTINES
SVN::Web::I18N::add_directory($path)
Adds a new directory to the list of directories in which localisations will be found. Any *.po and *.mo files in this directory will
automatically be scanned for localisations, and added to the language key given by the file's basename.
In case where two different directories both contain a localisation file that defines the same localisation key for the same language, the
localisation key from the most recently added directory will be used.
SVN::Web::I18N::loc_lang($lang)
Selects the language to use for subsequent calls to "loc()". The $lang parameter should be a valid language name -- i.e., there must exist
at least one $lang.po file in one of the directories used in a call to "SVN::Web::I18N::add_directory()".
SVN::Web::I18N::loc($text)
and
SVN::Web::I18N::loc($text, $param1, ...)
Returns the localised form of $text according to the localisation selected by the most recent call to "loc_lang()".
If the localisation expects parameters to fill in the localisation result they should be passed as the second and subsequent arguments.
If $text does not have a defined localised form it is returned with the parameters interpolated in to it.
SEE ALSO
Locale::Maketext, Locale::Maketext::Lexicon, SVN::Web
AUTHORS
Nik Clayton "<nik@FreeBSD.org>"
COPYRIGHT
Copyright 2006-2007 by Nik Clayton "<nik@FreeBSD.org>".
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
See <http://www.perl.com/perl/misc/Artistic.html>
perl v5.14.2 2012-06-11 SVN::Web::I18N(3pm)