Sponsored Content
Top Forums Shell Programming and Scripting Finding longest line in a Record Post 302515077 by SEinT on Tuesday 19th of April 2011 02:08:05 AM
Old 04-19-2011
Quote:
Originally Posted by Franklin52
Is this a homework assignment?
No, I am preparing for a technical portion of an interview where my knowledge of nawk scripting will be tested.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Finding a character in first line of a record

HI, I am pretty new to Unix scripting. I will need help in Finding a character in first line of a file or a set of files. The scenario is as follows: Lets consider a set of files which is having a character "ID"(without quotes) in the first line of each file.I need to find this character... (14 Replies)
Discussion started by: bsandeep_80
14 Replies

2. Shell Programming and Scripting

Find the length of the longest line

Dear All, To find the length of the longest line from a file i have used wc -L which is giving the proper output... But the problem is AIX os does not support wc -L command. so is there any other way 2 to find out the length of the longest line using awk or sed ? Regards, Pankaj (1 Reply)
Discussion started by: panknil
1 Replies

3. Shell Programming and Scripting

Finding longest common substring among filenames

I will be performing a task on several directories, each containing a large number of files (2500+) that follow a regular naming convention: YYYY_MM_DD_XX.foo_bar.A.B.some_different_stuff.EXT What I would like to do is automatically discover the part of the filenames that are common to all... (1 Reply)
Discussion started by: cmcnorgan
1 Replies

4. Shell Programming and Scripting

Bash script find longest line/lines in several files

Hello everyone... I need to find out, how to find longest line or possibly lines in several files which are arguments for script. The thing is, that I tried some possibilities before, but nothing worked correctly. Example when i use: awk ' { if ( length > L ) { L=length ;s=$0 } }END{ print... (23 Replies)
Discussion started by: 1tempus1
23 Replies

5. Shell Programming and Scripting

Reject the record if the record in the next line does not satisfy the pattern

Hi, I have a input file with the following entries: 1one 2two 3three 1four 2five 3six 1seven 1eight 1nine 2ten The output should be 1one 2two 3three 1four 2five 3six (2 Replies)
Discussion started by: supchand
2 Replies

6. Shell Programming and Scripting

Reject the record if the record in the next line does not begin with 2.

Hi, I have a input file with the following entries: 1one 2two 3three 1four 2five 3six 1seven 1eight 1nine 2ten 2eleven 2twelve 1thirteen 2fourteen The output should be: (5 Replies)
Discussion started by: supchand
5 Replies

7. Shell Programming and Scripting

finding the incorrect record

Hi , I have a scenario where i have to find the incorrect records in the file. In our comma delimited file , we have the following to be taken care : 1) if there is new line character then we have to capture the current line and the next line as error record Ex : In a comma... (8 Replies)
Discussion started by: ashwin3086
8 Replies

8. Shell Programming and Scripting

Finding the length of the longest column

Hi, I am trying to figure out how to get the length of the longest column in the entire file (because the length varies from one row to the other) I was doing this at first to check how many fields I have for the first row: awk '{print NF; exit}' file Now, I can do this: awk '{ if... (4 Replies)
Discussion started by: MIA651
4 Replies

9. Shell Programming and Scripting

wc -L giving incorrect length of longest line

Running below line gives 3957 as length of longest line in file 20121119_SRMNotes_init.dat awk ' { if ( length > 3950 ) { x = length } }END{ print x }' 20121119_SRMNotes_init.dat While wc -L 20121119_SRMNotes_init.dat gives output as 4329. Why is there a difference between these two commands.... (2 Replies)
Discussion started by: Satish Mantha
2 Replies

10. Shell Programming and Scripting

Finding the Latest record

Dear All, I have getting data as follows, the second field signifies table name and last one is time stamp. I have return always latest record based on time stamp. Could you please help me ? I/P ==== ... (1 Reply)
Discussion started by: srikanth38
1 Replies
AMOVERVIEW(8)						  System Administration Commands					     AMOVERVIEW(8)

NAME
amoverview - display file systems processed by Amanda over time SYNOPSIS
amoverview [--hostwidth width] [--diskwidth width] [--skipmissed] [--last] [--num0] [--togo0] [--verbose] [--config ] config DESCRIPTION
Amoverview displays a chart showing hosts and file systems processed by Amanda along with the backup level performed each day. See the amanda(8) man page for more details about Amanda. OPTIONS
--config config Use configuration config. --hostwidth width Set host field column width to width characters instead of 8. --diskwidth width Set disk field column width to width characters instead of 20. --skipmissed Compacts the output by only printing stats for the days Amanda actually ran. --last Outputs the last status of each disk at the start. Useful for long tapecycles and/or sparse reports. --num0 Outputs the number of level 0 dumps for each disk. --togo0 Outputs the number of runs until the last level 0 dump is overwritten. --verbose Amoverview can take a long while on large systems. This option reports intermediate steps while it is working. RESULTS
amoverview is a summary of the output of " amadmin <config> find ". When the last column of amadmin find contains anything other than "OK", amoverview translates this into "E" for that day. A number indicates the level of backup and it succeeded. An "E" indicates an error for that day. You get an "E" for all errors, like failed to connect, datatimeout, computer crashed, etc, but also for failing to write to tape. You can have an "E" followed by a number if a filesystem ran into end-of-tape once (gives an "E", and later that day, you flush it to a second tape (a number: the level, indicating success). If the flush failed too, you get a double "EE" for that day. You can also have a double code if you have two tapes in the changer and Amanda failed to write to tape the first time because it hit end of tape (resulting in "E0", for a full, "E1" for an incremental etc.) or twice with error ("EE"), and may a successful flush afterwards giving maybe "EE0". (Only the latest 2 characters are printed). EXAMPLE
This shows the /home file system on host2 was backed up at level 3 on the 8th, 9th and 10th of December, had a full backup on the 11th, a level 1 on the 12th and a level 2 on the 13th. # amoverview date 12 12 12 12 12 12 host disk 08 09 10 11 12 13 host1 / 0 1 1 1 1 1 host1 /var 0 1 1 1 1 1 host2 / 1 1 1 1 1 0 host2 /home 3 3 3 0 1 2 host2 /opt 1 1 1 1 1 1 host2 /var 1 1 0 1 1 1 SEE ALSO
amanda(8), amadmin(8) The Amanda Wiki: : http://wiki.zmanda.com/ AUTHOR
Stefan G. Weichinger <sgw@amanda.org> Amanda 3.3.1 02/21/2012 AMOVERVIEW(8)
All times are GMT -4. The time now is 02:12 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy