I have a delimited file (,) containing Name, Amount,Type,Address,zip,Tel and Extn. If any of this column information is missing (except TYPE and Extn),
I need to print that a spefic column value is missing in my output.
Example: row 2 is missing ZIP and the out put should contain NOZIP in the Zip column. How can write a code in Unix to process this file.
Input File Output File
Thanks..
Last edited by Don Cragun; 03-05-2015 at 03:00 PM..
Reason: Get rid of SIZE tags.
Hello
I need to read the columns from a flat file delimited by Hex code X02.
The Sample file is
Red^B1000^BJohn
Blue^B2000^BSam
Green^B3000^BDan
Note: Hex code X02 shows as ^B in vi.
I need to read the file and process the columns in each row.
I tried using awk -F command but... (7 Replies)
Hi All,
I have space delimited file similar to the one as shown below.. I need to convert it as a pipe delimited, the values inside the pipe delimited file should be as highlighted...
AA ATIU2345098809 009697 005374
BB ATIU2345097809 005445 006518
CC ATIU9685098809 003215 003571
DD... (7 Replies)
Hello Guys
I have a multiple character delimited flat file "|~|". when I tried to read the data the "|" character also coming
Example
I/P file
9882590|~|20111207|~|K03501000063005574033961|~|K|~|
Command to get the second column I used
awk -F"|~|" ' {print $2}' ... (2 Replies)
Hi i am new in scripting
how i can get 2 elements from first line of delimited txt file in shell scripts.
AA~101010~0~AB~8000~ABC0~
BB~101011~0~BC~8000~ABC~
CC~101012~0~CD~8000~ABC0~
DD~101013~0~AB~8000~ABC~
AA~101014~0~BC~8000~ABC0~
CC~101015~0~CD~8000~ABC~
can anyone plse help?... (3 Replies)
Hello folks, I have another doozy. I have two files. The first file has four fields in it. These four fields map to different locations in my second file. What I want to do is read the master file (file 2 - 23 fields) and compare each line against each record in file 1. If I get a match in all four... (4 Replies)
1. The problem statement, all variables and given/known data:
Hello!
I need help with this problem bash shell scripting that basically just reads the data in a tab delimited file and does the following below
1. Read in the data file Survey.txt and assign the column values to variables of... (6 Replies)
Hi How to make tab delimited file to space delimited?
in put file:
ABC kgy
jkh ghj
ash kjl
o/p file:
ABC kgy
jkh ghj
ash kjl
Use code tags, thanks. (1 Reply)
Hi Experts,
I have a tab deliminated file as below
myfile.txt
Local Group Memberships *Administrators *Guests
I need data in below format starting from 4th position.
myfile1.txt
Administrators Guests
the above one is just an example and there could... (15 Replies)
Hi, I have a rquirement in unix as below .
I have a text file with me seperated by | symbol and i need to generate a excel file through unix commands/script so that each value will go to each column.
ex:
Input Text file:
1|A|apple
2|B|bottle
excel file to be generated as output as... (9 Replies)
Discussion started by: raja kakitapall
9 Replies
LEARN ABOUT DEBIAN
archive::zip::memberread
Archive::Zip::MemberRead(3pm) User Contributed Perl Documentation Archive::Zip::MemberRead(3pm)NAME
Archive::Zip::MemberRead - A wrapper that lets you read Zip archive members as if they were files.
SYNOPSIS
use Archive::Zip;
use Archive::Zip::MemberRead;
$zip = Archive::Zip->new("file.zip");
$fh = Archive::Zip::MemberRead->new($zip, "subdir/abc.txt");
while (defined($line = $fh->getline()))
{
print $fh->input_line_number . "#: $line
";
}
$read = $fh->read($buffer, 32*1024);
print "Read $read bytes as :$buffer:
";
DESCRIPTION
The Archive::Zip::MemberRead module lets you read Zip archive member data just like you read data from files.
METHODS
Archive::Zip::Member::readFileHandle()
You can get a "Archive::Zip::MemberRead" from an archive member by calling "readFileHandle()":
my $member = $zip->memberNamed('abc/def.c');
my $fh = $member->readFileHandle();
while (defined($line = $fh->getline()))
{
# ...
}
$fh->close();
Archive::Zip::MemberRead->new($zip, $fileName)
Archive::Zip::MemberRead->new($zip, $member)
Archive::Zip::MemberRead->new($member)
Construct a new Archive::Zip::MemberRead on the specified member.
my $fh = Archive::Zip::MemberRead->new($zip, 'fred.c')
setLineEnd(expr)
Set the line end character to use. This is set to
by default except on Windows systems where it is set to
. You will only need
to set this on systems which are not Windows or Unix based and require a line end diffrent from
. This is a class method so call as
"Archive::Zip::MemberRead"->"setLineEnd($nl)"
rewind()
Rewinds an "Archive::Zip::MemberRead" so that you can read from it again starting at the beginning.
input_record_separator(expr)
If the argumnet is given, input_record_separator for this instance is set to it. The current setting (which may be the global $/) is
always returned.
input_line_number()
Returns the current line number, but only if you're using "getline()". Using "read()" will not update the line number.
close()
Closes the given file handle.
buffer_size([ $size ])
Gets or sets the buffer size used for reads. Default is the chunk size used by Archive::Zip.
getline()
Returns the next line from the currently open member. Makes sense only for text files. A read error is considered fatal enough to
die. Returns undef on eof. All subsequent calls would return undef, unless a rewind() is called. Note: The line returned has the
input_record_separator (default: newline) removed.
read($buffer, $num_bytes_to_read)
Simulates a normal "read()" system call. Returns the no. of bytes read. "undef" on error, 0 on eof, e.g.:
$fh = Archive::Zip::MemberRead->new($zip, "sreeji/secrets.bin");
while(1)
{
$read = $fh->read($buffer, 1024);
die "FATAL ERROR reading my secrets !
" if (!defined($read));
last if (!$read);
# Do processing.
....
}
AUTHOR
Sreeji K. Das, <sreeji_k@yahoo.com> See Archive::Zip by Ned Konz without which this module does not make any sense!
Minor mods by Ned Konz.
COPYRIGHT
Copyright 2002 Sreeji K. Das.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
perl v5.14.2 2009-06-30 Archive::Zip::MemberRead(3pm)