05-02-2008
Quote:
Originally Posted by
shirleyeow
Hi Klashxx,
Yup, is Solaris box.
Hi DILEEP410,
The command is ok but it didnt return the path that I want, the LANGUAGE, DIALECT and FILE value are missing. Please advise.
RESULT:
[10001]
NAME=FRAGMENT
LANGUAGE=1
DIALECT=0
GENDER=NONE
FILE=TEST1
DIRECTORY=D:/DETAILS///
END
Thank you.
Best Regards,
Shirley
I tried it in solaris 5.8 and is working fine as you can see the result below
nawk -F"=" '/DIRECTORY/ {print $1"=D:/DETAILS/"a["LANGUAGE"]"/"a["DIALECT"]"/"tolower(a["FILE"]);next}a[$1]=$2{}1' file.txt
[10001]
NAME=FRAGMENT
LANGUAGE=1
DIALECT=0
GENDER=NONE
FILE=TEST1
DIRECTORY=D:/DETAILS/1/0/test1
END
[10002]
NAME=FRAGMENT
LANGUAGE=1
DIALECT=0
GENDER=NONE
FILE=TEST2
DIRECTORY=D:/DETAILS/1/0/test2
END
[10003]
NAME=FRAGMENT
LANGUAGE=1
DIALECT=0
GENDER=NONE
FILE=TEST3
DIRECTORY=D:/DETAILS/1/0/test3
END
9 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hello,
I searched the forums and didn't see a situation like this:
I cannot figure out how to parse out just the file name from the full path. The path looks like this:
\\foo\bar\filename.ext
I don't think something like 'cut' will work so I tried to whip up a regex but couldn't get it... (12 Replies)
Discussion started by: bytesnoop
12 Replies
2. Shell Programming and Scripting
I am fairly new to programming and trying to resolve this problem. I have the file like this.
CHROM POS REF ALT 10_sample.bam 11_sample.bam 12_sample.bam 13_sample.bam 14_sample.bam 15_sample.bam 16_sample.bam
tg93 77 T C T T T T T
tg93 79 ... (4 Replies)
Discussion started by: empyrean
4 Replies
3. Shell Programming and Scripting
I am looking to parse a text file output and set variables based on what is cropped from the parsing.
Below is my script I am looking to add this feature too.
All it does is scan a certain area of users directories for anyone using up more than X amount of disk space. It then writes to the... (4 Replies)
Discussion started by: es760
4 Replies
4. Shell Programming and Scripting
Hello:
I am working parsing a large input file which will be broken down into multiples based on the second field in the file, in this case: STORE.
The idea is to create each file with the corresponding store number, for example: Report_$STORENUM_$DATETIMESTAMP , and obtaining the... (7 Replies)
Discussion started by: ec012
7 Replies
5. Shell Programming and Scripting
Hi All,
Can you please provide some pointers to move files from Base path to multiple paths in efficient way.Folder Structure is already created.
/Path/AdminUser/User1/1111/Reports/aaa.txt to /Path/User1/1111/Reports/aaa.txt
/Path/AdminUser/User1/2222/Reports/bbb.txt to... (6 Replies)
Discussion started by: karthikgv417
6 Replies
6. Shell Programming and Scripting
Hello ,
Can anyone please help me to solve the below -
Input.txt
source table abc
col1 char
col2 number
source table bcd
col1 date
col2 char
output should be 2 files based on the row separator "source table"
abc.txt
col1 char (6 Replies)
Discussion started by: Pratik4891
6 Replies
7. UNIX for Beginners Questions & Answers
Hi there,
I would like to use awk to reformat a tab-delimited file containing three columns as follows:
Data file:
sample 1 173
sample 269 530
sample 687 733
sample 1699 1779
Desired output file:
sample 174..265, 531..686, 734..1698
I need the value... (5 Replies)
Discussion started by: emiley
5 Replies
8. Shell Programming and Scripting
Hi ALL,
We have requirement in a file, i have multiple rows.
Example below:
Input file rows
01,1,102319,0,0,70,26,U,1,331,000000113200000011920000001212
01,1,102319,0,1,80,20,U,1,241,00000059420000006021
I need my output file should be as mentioned below. Last field should split for... (4 Replies)
Discussion started by: kotra
4 Replies
9. Shell Programming and Scripting
Hi All,
Need some help in parsing a directory listing .. output into 2 files
Input file
level1,/level2/level3/level4/ora001,10,IBB23
level1,/level2/level3/level4/ora001/blu1,,IBB23
level1,/level2/level3/level4/ora001/clu1,,IBB23
level1,/level2/level3/level4/ora002,,IBB24... (10 Replies)
Discussion started by: greycells
10 Replies
LEARN ABOUT DEBIAN
mojo::cookie::response
Mojo::Cookie::Response(3pm) User Contributed Perl Documentation Mojo::Cookie::Response(3pm)
NAME
Mojo::Cookie::Response - HTTP 1.1 response cookie container
SYNOPSIS
use Mojo::Cookie::Response;
my $cookie = Mojo::Cookie::Response->new;
$cookie->name('foo');
$cookie->value('bar');
say $cookie;
DESCRIPTION
Mojo::Cookie::Response is a container for HTTP 1.1 response cookies.
ATTRIBUTES
Mojo::Cookie::Response inherits all attributes from Mojo::Cookie and implements the followign new ones.
"domain"
my $domain = $cookie->domain;
$cookie = $cookie->domain('localhost');
Cookie domain.
"httponly"
my $httponly = $cookie->httponly;
$cookie = $cookie->httponly(1);
HttpOnly flag, which can prevent client side scripts from accessing this cookie.
"max_age"
my $max_age = $cookie->max_age;
$cookie = $cookie->max_age(60);
Max age for cookie in seconds.
"path"
my $path = $cookie->path;
$cookie = $cookie->path('/test');
Cookie path.
"secure"
my $secure = $cookie->secure;
$cookie = $cookie->secure(1);
Secure flag, which instructs browsers to only send this cookie over HTTPS connections.
METHODS
Mojo::Cookie::Response inherits all methods from Mojo::Cookie and implements the following new ones.
"expires"
my $expires = $cookie->expires;
$cookie = $cookie->expires(time + 60);
$cookie = $cookie->expires(Mojo::Date->new(time + 60));
Expiration for cookie in seconds.
"parse"
my $cookies = $cookie->parse('f=b; path=/');
Parse cookies.
"to_string"
my $string = $cookie->to_string;
Render cookie.
SEE ALSO
Mojolicious, Mojolicious::Guides, <http://mojolicio.us>.
perl v5.14.2 2012-09-05 Mojo::Cookie::Response(3pm)