@Akshay: Oh i have no problem with the code. However, I would like to understand the logic behind duplicate records.
@Don: Hi DOn, Thanks. Could you please explain the logic behind. Also how did you manage to put "small code tags" ?
Last edited by quincyjones; 03-31-2015 at 06:58 AM..
Hi,
I have these out put field seperator changed to "|" in my awk command, but it didn't give me the result.
Can someone help me find out why?
=======================================
/bin/awk 'BEGIN { OFS="|" } { print $0 }' list.tmp.$$ > listtmp.$$
=======================================... (1 Reply)
OFS is inbuild command in awk.
I have a file file.txt
abc : def : ghi
jkl : mno: pqr
stu : vwx :yzz
code i used:
awk -F ":" 'BEGIN {OFS="|"} {print $1,$2}' file.txt
output:
abc def
jkl mno
stu vwx
but as i have used OFS="|" and i am expecting output as:
abc | def
jkl... (4 Replies)
Hi All,
I have a comma seperated delimited file with 10 columns. I need to convert it into TAB seperated delimited file.
awk -F"," '{print $1"\t"$2"\t"$3"\t"$4"\t"$5"\t"$6"\t"$7"\t"$8"\t"$9"\t"$10}' a.txt >> b.txt
how to use OFS to get the same output. I have tried by googling, but it... (5 Replies)
Hi,
I am trying to parse regular XML file where I have to reduce number of decimal points in some xml elements. I am using following AWK command to achive that :
#!/bin/ksh
EDITCMD='BEGIN { FS = ""; OFS=FS }
{
if ( $3 ~ "*\\.*" && length(substr($3,1+index($3,"."))) == 15 ) {... (4 Replies)
I have a file that looks like this:
Infile.seq
I want to output the DNA sequence and add the filename as the identifier. The output file should look like this:
I am using the following code but I do not understand why the sequence is not in the output:
awk 'BEGIN { RS =... (11 Replies)
Hi Im trying to tidy up the output of a who command when it writes to a log, everything I've tried doesnt seem to work though, any help would be massively appreciated. Im using the awk command to set the OFS as tab.
#!/bin/bash
who >> /export/home/tjmoore/logusers
awk -F 'BEGIN... (3 Replies)
Hi, Could anyone tell me what Im doing wrong here any help will be much appreciated
#!/bin/bash
ls -ltr /export/home/tjmoore > /export/home/tjmoore/log100
awk -F " " /export/home/tjmoore/log100 'BEGIN {OFS="\t";} {print $1,$2,$3,$4,$5,
$6,$7,$8,$9;}' > /export/home/tjmoore/log1001
I... (9 Replies)
Hello,
I have an issue with adding commas as delimiters in this scenario:
cat xtr3.rpl|head -5|awk 'BEGIN {OFS=","} {print $1,$2,$3,$4}'
Produces this output:
00530083,0000000471,000000000000.00,000000000000.00
00530085,0000000471,000000000000.00,000000000000.00... (10 Replies)
file:
sasa|asasa|asasa|asas
erer|Erer|rere|ererer
Output needed :
sasa:asasa:asasa:asas
erer:Erer:rere:ererer
Im getting output, when i use the $1,$2.
awk -F'|' 'BEGIN{OFS=":";} {print $1,$2; }' file
Output :
sasa:asasa
erer:Erer
But when i need the whole column, i... (5 Replies)
Hi ,
I am having a problem with my awk oneliner , which for some reason leaves the first two records
Input File
$ cat file1
A1:B1:C1:NoLimit
M1:M2:M3:Limit
A2:B2:C2,C3,C4,C5
A3:B3:C3,C4,C5,C6,C7Desired output
A1,B1,C1,NoLimit
M1,M2,M3,Limit
A2,B2,C2
,,,C3
,,,C4
,,,C5
A3,B3,C3... (5 Replies)
Discussion started by: chidori
5 Replies
LEARN ABOUT DEBIAN
plack::session::store::file
Plack::Session::Store::File(3pm) User Contributed Perl Documentation Plack::Session::Store::File(3pm)NAME
Plack::Session::Store::File - Basic file-based session store
SYNOPSIS
use Plack::Builder;
use Plack::Middleware::Session;
use Plack::Session::Store::File;
my $app = sub {
return [ 200, [ 'Content-Type' => 'text/plain' ], [ 'Hello Foo' ] ];
};
builder {
enable 'Session',
store => Plack::Session::Store::File->new(
dir => '/path/to/sessions'
);
$app;
};
# with custom serializer/deserializer
builder {
enable 'Session',
store => Plack::Session::Store::File->new(
dir => '/path/to/sessions',
# YAML takes it's args the opposite order
serializer => sub { YAML::DumpFile( reverse @_ ) },
deserializer => sub { YAML::LoadFile( @_ ) },
);
$app;
};
DESCRIPTION
This implements a basic file based storage for session data. By default it will use Storable to serialize and deserialize the data, but
this can be configured easily.
This is a subclass of Plack::Session::Store and implements its full interface.
METHODS
new ( %params )
The %params can include dir, serializer and deserializer options. It will check to be sure that the dir is writable for you.
dir This is the directory to store the session data files in, if nothing is provided then "/tmp" is used.
serializer
This is a CODE reference that implements the serialization logic. The CODE ref gets two arguments, the $value, which is a HASH
reference to be serialized, and the $file_path to save it to. It is not expected to return anything.
deserializer
This is a CODE reference that implements the deserialization logic. The CODE ref gets one argument, the $file_path to load the data
from. It is expected to return a HASH reference.
BUGS
All complex software has bugs lurking in it, and this module is no exception. If you find a bug please either email me, or add the bug to
cpan-RT.
AUTHOR
Stevan Little <stevan.little@iinteractive.com>
COPYRIGHT AND LICENSE
Copyright 2009, 2010 Infinity Interactive, Inc.
<http://www.iinteractive.com>
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
perl v5.12.4 2011-07-27 Plack::Session::Store::File(3pm)