Replace variable value in first file based on records in second
Hello ,
I have below files
a) File A
b) File b
I want to replace the values of $$SCHEMA_NAME , $$COL , $$TABLE_NAME, $$VALUE with the values mentioned in right ( i.e. test,DATETIME,table1,1234) in file a
Hi all,
I would like to extract records of a file based on a condition. The file contains 47 fields, and I would like to extract only those records that match a certain value in one of the columns, e.g.
COL1 COL2 COL3 ............... COL47
1 XX 45 ... (4 Replies)
Hi All,
I have two files say file1 and file2.
I want to check the number of records in file1 and if its atleast 2 (i.e., 2 or greater than 2 ) then I have to check records in file2 .If records in file2 is atleast 1 (i.e. if its not empty ) i have to set some conditions .
Could you pls... (3 Replies)
Hi,
I need to execute parallel with while loop.
Input File(source_file.csv) contains filenames the below
source_file.csv file contains
Customer1.txt
Product1.txt
Sales.txt
Emp.txt
Dept.txt
Based on the number of rows that file I want to run the script ‘n' times.
while... (2 Replies)
Hi,
I am looking for an awk script which should help me to meet the following requirement:
File1 has records in following format
INF: FAILEd RECORD AB1234
INF: FAILEd RECORD PQ1145
INF: FAILEd RECORD AB3215
INF: FAILEd RECORD AB6114
............................ (2 Replies)
Hi,
To load a big file in a table,I have a make sure that all rows in the file has same number of the columns .
So in my file if I am getting any rows which have columns not equal to 6 , I need to delete it . Delimiter is space and columns are optionally enclosed by "".
This can be ... (1 Reply)
A text file has 2 fields (Data, Filename) delimited by # as below,
Data,Filename
Row1 -> abc#Test1.xml
Row2 -> xyz#Test2.xml
Row3 -> ghi#Test3.xml
The content in first field has to be written into a file where filename should be considered from second field.
So from... (4 Replies)
I have to split a file based on number of lines and the below command works fine:
split -l 2 Inputfile -d OutputfileMy input file contains header, detail and trailor info as below:
H
D
D
D
D
TMy split files for the above command contains:
First File:
H
DSecond File:
... (11 Replies)
Hello,
I want to filter records of a file if they fall in range associated with a second file. First the chr number (2nd col of 1st file and 1st col of 2nd file) needs to be matched. Then if the 3rd col of the first file falls within any of the ranges specified by the 2nd and 3rd cols , then... (4 Replies)
Hi Folks -
Linux Version = Linux 2.6.39-400.128.17.el5uek x86_64
I have a process that determines the start and end load periods for an Oracle data load process.
The variables used are as follows follows:
They are populated like such:
However, the load requires the month to be the... (11 Replies)
Dear Experts,
I have a log file that contains a timestamp, I would like to filter record from that file based on timestamp. For example refer below file -
cat sample.txt
Jan 19 20:51:48 mukul-Vostro-14-3468 systemd: pam_unix(systemd-user:session): session opened for user root by (uid=0)... (6 Replies)
Discussion started by: mukulverma2408
6 Replies
LEARN ABOUT DEBIAN
marc::file
MARC::File(3pm) User Contributed Perl Documentation MARC::File(3pm)NAME
MARC::File - Base class for files of MARC records
SYNOPSIS
use MARC::File::USMARC;
# If you have werid control fields...
use MARC::Field;
MARC::Field->allow_controlfield_tags('FMT', 'LDX');
my $file = MARC::File::USMARC->in( $filename );
while ( my $marc = $file->next() ) {
# Do something
}
$file->close();
undef $file;
EXPORT
None.
METHODS
in()
Opens a file for import. Ordinarily you will use "MARC::File::USMARC" or "MARC::File::MicroLIF" to do this.
my $file = MARC::File::USMARC->in( 'file.marc' );
Returns a "MARC::File" object, or "undef" on failure. If you encountered an error the error message will be stored in $MARC::File::ERROR.
Optionally you can also pass in a filehandle, and "MARC::File". will "do the right thing".
my $handle = IO::File->new( 'gunzip -c file.marc.gz |' );
my $file = MARC::File::USMARC->in( $handle );
next( [&filter_func] )
Reads the next record from the file handle passed in.
The $filter_func is a reference to a filtering function. Currently, only USMARC records support this. See MARC::File::USMARC's "decode()"
function for details.
Returns a MARC::Record reference, or "undef" on error.
skip()
Skips over the next record in the file. Same as "next()", without the overhead of parsing a record you're going to throw away anyway.
Returns 1 or undef.
warnings()
Simlilar to the methods in MARC::Record and MARC::Batch, "warnings()" will return any warnings that have accumulated while processing this
file; and as a side-effect will clear the warnings buffer.
close()
Closes the file, both from the object's point of view, and the actual file.
write()
Writes a record to the output file. This method must be overridden in your subclass.
decode()
Decodes a record into a USMARC format. This method must be overridden in your subclass.
RELATED MODULES
MARC::Record
TODO
o "out()" method
We only handle files for input right now.
LICENSE
This code may be distributed under the same terms as Perl itself.
Please note that these modules are not products of or supported by the employers of the various contributors to the code.
AUTHOR
Andy Lester, "<andy@petdance.com>"
perl v5.10.1 2010-03-29 MARC::File(3pm)