Sponsored Content
Top Forums Shell Programming and Scripting Line with maximum no . of characters Post 302092718 by shreedhar on Thursday 12th of October 2006 01:31:18 AM
Old 10-12-2006
#! /usr/bin/perl
use strict;

$file='max_char'; #input file

open (FH, $file) || die "Error in Opening:$file file\n";
my $count;
my $len;
my $read;
my $max;
my $line;
while ($read = <FH>) {
$count++;
$len=length($read);
if ($len > $max) {
$max = $len;
$line = $count;
}
}
print "Max char found:$max in line number: $line\n";
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

What is the Maximum number of characters that i can store in a variable?

Hi, Can any one tell me, what is the maximum number of characters that can be stored in a variable? Thanks in Advance, Shan (9 Replies)
Discussion started by: pcshan
9 Replies

2. UNIX for Advanced & Expert Users

Print the line containing the maximum value in a column

Dear all! I want to find the maximum value in two specific columns with numbers, and then print the entire line containing this value. The file may look like: 1001 34.5 68.7 67 1002 22.0 40.1 32 1003 11.3 34.8 45 I want to find the maximum value within column 2... (22 Replies)
Discussion started by: kingkong
22 Replies

3. UNIX for Dummies Questions & Answers

what is the maximum length of th os-command line in Unix.

Hi All, I didn't find any thread that match this question so I hope it's not redundant. I am totally new to Unix. I want to know what is the maximum length of the os-commandline in Unix. Will it cause any problem if I run any application whose total path length is much longer than 256... (2 Replies)
Discussion started by: kumardesai
2 Replies

4. UNIX for Advanced & Expert Users

help on ksh and sql..getting error as is too long. maximum size is 240 characters."

Hi, In my script i am executing sql file and there are some variables in SQL files which are assigned at run time. one of the variable value is having more than 240 characters and at time of execution its getting failed with error as "is too long. maximum size is 240 characters." ... (1 Reply)
Discussion started by: pooga17
1 Replies

5. UNIX and Linux Applications

handling maximum number characters in an input file

Hi, Can anyone help me? An input file has three lines. Each line should only be 2098 as number of characters however line 2 of the input file has more than the maximum number of characters, it exceeded up to 4098. What should I do so that could handle maximum number of characters? that it could... (1 Reply)
Discussion started by: chrysSty
1 Replies

6. Shell Programming and Scripting

Maximum value of each line entry

Dear power users, I have a file like this: AA 8 AA 6 AA 5 AA 4 AA 3 BB 9 BB 4 BB 3 BB 2 ZZ 5 ZZ 3 ZZ 1 ... The characters in colum one are variously different until the end of the file. I want to extract the maximum value of each entry in... (3 Replies)
Discussion started by: kecopx
3 Replies

7. Shell Programming and Scripting

Maximum number of characters in a line.

Hi, Could any one please let me know what is the maximum number of characters that will fit into a single line of a flat file on a unix. Thanks. (1 Reply)
Discussion started by: Shivdatta
1 Replies

8. Shell Programming and Scripting

Maximum command line arguments

Hi, Can anyone please help me to know what is the maximum number of command line arguments that we can pass in unix shell script? Thanks in advance, Punitha.S (2 Replies)
Discussion started by: puni
2 Replies

9. Programming

Maximum length of a line

How can I change the maximum length of a programming line in fortran and C (specifically in fortran 77)? Seems the default maximum length is 72 in fortran 77. Thanks. (4 Replies)
Discussion started by: hbar
4 Replies

10. Shell Programming and Scripting

Remove first 2 characters and last two characters of each line

here's what im trying to do. i have a file containing lines similar to this: data.txt: 1hsRmRsbHRiSFZNTTA1dlEyMWFkbU5wUW5CSlIyeDFTVU5SYjJOSFRuWmpia0ZuWXpKV2FHTnRU 1lKUnpWMldrZFZaMG95V25oYQpSelEyWTBka2QyRklhSHBrUjA1b1kwUkJkd3BOVXpWM1lVaG5k... (5 Replies)
Discussion started by: SkySmart
5 Replies
labelit_hsfs(1M)					  System Administration Commands					  labelit_hsfs(1M)

NAME
labelit_hsfs - provide and print labels for hsfs file systems SYNOPSIS
/usr/sbin/labelit -F hsfs [generic_options] [-o specific_options] special DESCRIPTION
labelit can be used to provide labels for unmounted CD-ROM images (CD-ROMs may not be labeled, as they are read-only media). generic_options are options supported by the generic labelit command. If no specific_options are specified, labelit prints the current value of all label fields. The special name should be the physical disk section (for example, /dev/dsk/c0d0s6). OPTIONS
-o Use one or more of the following name=value pairs separated by commas (with no intervening spaces) to specify values for specific label fields. According to the ISO 9660 specification, only certain sets of characters may be used to fill in these labels. Thus, ``d-characters'' below refers to the characters `A' through `Z', the digits `0' through `9', and the `_' (underscore) character. ``a-characters'' below refers to `A' through `Z', `0' through `9', space, and the following characters: !"%&'()*+,-./:;<=>?_. absfile= Abstract file identifier, d-characters, 37 characters maximum. applid= Application identifier, d-characters, 128 characters maximum. bibfile= Bibliographic file identifier, d-characters, 37 characters maximum. copyfile= Copyright file identifier, d-characters, 128 maximum. prepid= Data preparer identifier, d-characters, 128 maximum. pubid= Publisher identifier, d-characters, 128 maximum. sysid= System identifier, a-characters, 32 maximum. volid= Volume identifier, d-characters, 32 maximum. volsetid= Volume set identifier, d-characters, 128 maximum. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWcsu | +-----------------------------+-----------------------------+ SEE ALSO
labelit(1M), volcopy(1M), attributes(5) SunOS 5.10 20 Mar 1992 labelit_hsfs(1M)
All times are GMT -4. The time now is 07:21 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy