Is there a command that sets a variable length?
I have a input of a variable length field but my output for that field needs to be set to 32 char.
Is there such a command?
I am on a sun box running ksh
Thanks (2 Replies)
Hi ,
I have a peculiar case, where my sed command is working on a file which contains lines of small length.
sed "s/XYZ:1/XYZ:3/g" abc.txt > xyz.txt
when abc.txt contains lines of small length(currently around 80 chars) , this sed command is working fine.
when abc.txt contains lines of... (3 Replies)
I am attempting to use awk to validate the length of each line in a fixed-width raw data file prior to reading in the data. I am happy with....
{if (length() == 403)
print > "valid.file";
else
print > " invalid.file"
}
...to separate out the valid length lines from invalid length... (3 Replies)
Hi,
I have requirement where record length is stored in an variable RECORD_LENGTH
Code goes as follows
RECORD_LENGTH=537
the above is arrived from
#RECORD_LENGTH=`awk -F"=" '{$sum+=$2} END{print $sum}' DBP_Claims_CFG.ini`
awk '
{
if (length() == '$RECORD_LENGTH')
print FNR, $0... (4 Replies)
Very, very new to unix scripting and have a unique situation. I have a file of records that contain 3 records types:
(H)eader Records
(D)etail Records
(T)railer Records
The Detail records are 82 bytes in length which is perfect. The Header and Trailer records sometimes are 82 bytes in... (3 Replies)
Hi,
Can anyone help with a effective solution ?
I need to change a variable length text field (between 1 - 18 characters) to a fixed length text of 18 characters with the unused portion, at the end, filled with spaces.
The text field is actually field 10 of a .csv file however I could cut... (7 Replies)
Hello Everyone,
I am stuck with one issue while working on abstract flat file which i have to use as input and load data to table.
Input Data-
------ ------------------------ ---- -----------------
WFI001 Xxxxxx Control Work Item A Number of Records
------ ------------------------... (5 Replies)
I have sourcefile and structure of source file,i want to check whether datatype and length mention in emp.txt is same as source file.
Example:
in emp.txt first row contains sno number so in source file also first column should contain only number if data is other than number then that... (1 Reply)
Discussion started by: katakamvivek
1 Replies
LEARN ABOUT DEBIAN
alzabo::runtime::uniquerowcache
Alzabo::Runtime::UniqueRowCache(3pm) User Contributed Perl Documentation Alzabo::Runtime::UniqueRowCache(3pm)NAME
Alzabo::Runtime::UniqueRowCache - Implements a row cache for Alzabo
SYNOPSIS
use Alzabo::Runtime::UniqueRowCache;
Alzabo::Runtime::UniqueRowCache->clear();
DESCRIPTION
This is a very simple caching mechanism for "Alzabo::Runtime::Row" objects that tries to ensure that for there is never more than one row
object in memory for a given database row.
To use it, simply load it.
It can be foiled through the use of "Storable" or other "deep magic" cloning code, like in the "Clone" module.
The cache is a simple hash kept in memory. If you use this module, you are responsible for clearing the cache as needed. The only time it
is cleared automatically is when a table update or delete is performed, in which case all cached rows for that table are cleared.
In a persistent environment like mod_perl, you should clear the cache on a regular basis in order to prevent the cache from getting out of
sync with the database. A good way to do this is to clear it at the start of every request.
METHODS
All methods provided are class methods.
* clear
This clears the entire cache
* clear_table( $table_object )
Given a table object, this method clears all the cached rows from that table.
* row_in_cache( $table_name, $row_id )
Given a table name and a row id, as returned by the "Alzabo::Runtime::Row->id_as_string" method, this method returns the matching row
from the cache, if it exists. Otherwise it returns undef.
* delete_from_cache( $table_name, $row_id )
Given a table name and a row id, as returned by the "Alzabo::Runtime::Row->id_as_string" method, this method returns the matching row
from the cache.
* write_to_cache( $row_object )
Given a row object, this method stores it in the cache.
AVOIDING THE CACHE
If you want to not cache a row, then you can pass the "no_cache" parameter to any table or schema method that creates a new row object or a
cursor, such as "Alzabo::Runtime::Table->insert()", "Alzabo::Runtime::Table->rows_where()".
AUTHOR
Dave Rolsky, <autarch@urth.org>
perl v5.8.8 2007-12-23 Alzabo::Runtime::UniqueRowCache(3pm)