Sponsored Content
Full Discussion: Length validation
Top Forums Shell Programming and Scripting Length validation Post 302826303 by Lakshman_Gupta on Wednesday 26th of June 2013 09:46:24 AM
Old 06-26-2013
Use below just modified.

Code:
awk -F"," '{if(length($1)>12){print "Row:" $0 "\nService ID have higher precision"}else{print "Row:" $0 "\nService ID have lesser precision"}}' filename


Last edited by Franklin52; 06-26-2013 at 11:02 AM.. Reason: Code tags
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

creating a fixed length output from a variable length input

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)
Discussion started by: r1500
2 Replies

2. UNIX for Dummies Questions & Answers

Sed working on lines of small length and not large length

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)
Discussion started by: thanuman
3 Replies

3. Shell Programming and Scripting

AWK - Line length validation

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)
Discussion started by: en7smb
3 Replies

4. UNIX for Dummies Questions & Answers

What the command to find out the record length of a fixed length file?

I want to find out the record length of a fixed length file? I forgot the command. Any body know? (9 Replies)
Discussion started by: tranq01
9 Replies

5. Shell Programming and Scripting

AWK - Line length validation

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)
Discussion started by: ainuddin
4 Replies

6. Shell Programming and Scripting

Make variable length record a fixed length

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)
Discussion started by: jclanc8
3 Replies

7. Shell Programming and Scripting

changing a variable length text to a fixed length

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)
Discussion started by: dc18
7 Replies

8. Shell Programming and Scripting

Flat file-make field length equal to header length

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)
Discussion started by: sonali.s.more
5 Replies

9. Shell Programming and Scripting

Datatype and length validation

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
Alzabo::Runtime::JoinCursor(3pm)			User Contributed Perl Documentation			  Alzabo::Runtime::JoinCursor(3pm)

NAME
Alzabo::Runtime::JoinCursor - Cursor that returns arrays of "Alzabo::Runtime::Row" objects SYNOPSIS
use Alzabo::Runtime::JoinCursor; my $cursor = $schema->join( tables => [ $foo, $bar ], where => [ $foo->column('foo_id'), '=', 1 ] ); while ( my @rows = $cursor->next ) { print $rows[0]->select('foo'), " "; print $rows[1]->select('bar'), " "; } DESCRIPTION
Objects in this class are used to return arrays of Alzabo::Runtime::Row objects when requested. The cursor does not preload objects but rather creates them on demand, which is much more efficient. For more details on the rational please see the RATIONALE FOR CURSORS section in Alzabo::Design. INHERITS FROM
"Alzabo::Runtime::Cursor" METHODS
next Returns the next array of "Alzabo::Runtime::Row" objects or an empty list if no more are available. If an individual row could not be fetched, then the array may contain some "undef" values. For outer joins, this is normal behavior, but for regular joins, this probably indicates a data error. all_rows This method fetches all the rows available from the current point onwards. This means that if there are five set of rows that will be returned when the object is created and you call "next()" twice, calling "all_rows()" after it will only return three sets. The return value is an array of array references. Each of these references represents a single set of rows as they would be returned from the "next" method. reset Resets the cursor so that the next "next()" call will return the first row of the set. count Returns the number of rowsets returned by the cursor so far. next_as_hash Returns the next rows in a hash, where the hash keys are the table names and the hash values are the row object. If a table has been included in the join via an outer join, then it is only included in the hash if there is a row for that table. AUTHOR
Dave Rolsky, <autarch@urth.org> perl v5.8.8 2007-12-23 Alzabo::Runtime::JoinCursor(3pm)
All times are GMT -4. The time now is 04:09 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy