"Default" Record Lengths


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers "Default" Record Lengths
# 1  
Old 08-26-2001
Question "Default" Record Lengths

Hello -

QUESTION:
Is there a way to override the default record length limitation over awk in Unix?
Or, is there a better way to do what I am trying to do than the way I am trying to do it now? (See BACKGROUND and CURRENT PROCEDURE below...)

BACKGROUND:
In a Kornshell script, I have to search a file using variable criteria and produce a range of records from within the original input file. I am piping the file from Unix Kornshell commands to an awk procedure. I basically want to extract a range of records out of the original file, based on input criteria.

PROBLEM:
Awk is relaying to me that the record is too long to process.

CURRENT PROCEDURE:
To overcome the length problem, I am "cut"-ting the records as I pipe them to the awk procedure, and that is working OK - - I do get the expected output from the procedure.
But then I have to use a Unix "grep" with the output of the awk procedure against the original file to put the selected records from the file 'back together' with the original. Consequently, the "grep" is taking too long (it is an interactive script).
Is there a better way to do this?
- -
FYI:
The original records are a bit over 7000 bytes in length.
The "cut" records passed to and output from awk are 50 bytes.
- -
Thanks,
Jim
 
Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. AIX

Apache 2.4 directory cannot display "Last modified" "Size" "Description"

Hi 2 all, i have had AIX 7.2 :/# /usr/IBMAHS/bin/apachectl -v Server version: Apache/2.4.12 (Unix) Server built: May 25 2015 04:58:27 :/#:/# /usr/IBMAHS/bin/apachectl -M Loaded Modules: core_module (static) so_module (static) http_module (static) mpm_worker_module (static) ... (3 Replies)
Discussion started by: penchev
3 Replies

2. Shell Programming and Scripting

Bash script - Print an ascii file using specific font "Latin Modern Mono 12" "regular" "9"

Hello. System : opensuse leap 42.3 I have a bash script that build a text file. I would like the last command doing : print_cmd -o page-left=43 -o page-right=22 -o page-top=28 -o page-bottom=43 -o font=LatinModernMono12:regular:9 some_file.txt where : print_cmd ::= some printing... (1 Reply)
Discussion started by: jcdole
1 Replies

3. Shell Programming and Scripting

Capture the last record number using "awk" NR variable

Hi Team. I am trying to capture the last record number from a file using the below command ( assuming abc.txt has 21 records and I want 21 as output ) awk'{c=NR;print c}'abc.txt But it is printing all the record number. Can someone please help modify the above command? (8 Replies)
Discussion started by: chatwithsaurav
8 Replies

4. UNIX for Dummies Questions & Answers

Using "mailx" command to read "to" and "cc" email addreses from input file

How to use "mailx" command to do e-mail reading the input file containing email address, where column 1 has name and column 2 containing “To” e-mail address and column 3 contains “cc” e-mail address to include with same email. Sample input file, email.txt Below is an sample code where... (2 Replies)
Discussion started by: asjaiswal
2 Replies

5. HP-UX

DLT 7000 tape drive failing with "write error on a record in the index"

HP rp5450 (L2000) running HP-UX 11.11B Using DLT 7000 and DLT 4000 tape drives for nightly full backups Backup jobs created by SAM DLT 7000 cron entry is as follows: 00 2 * * 1-6 /usr/sam/lbin/br_backup DLT FULL Y /dev/rmt/0m /var/sam/graphLCAa17036 root Y 1 N > /var/sam/SAM_br_msgs 2>&1... (1 Reply)
Discussion started by: dreh99
1 Replies

6. Shell Programming and Scripting

awk command to replace ";" with "|" and ""|" at diferent places in line of file

Hi, I have line in input file as below: 3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL My expected output for line in the file must be : "1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL" Can someone... (7 Replies)
Discussion started by: shis100
7 Replies

7. UNIX for Advanced & Expert Users

"while read ..." loop exiting after reading only one record

Greeting, The following script completes after reading only one record from the input file that contains many records. I commented out the "ssh" and get what I expect, an echo of all the records in the input.txt file. Is ssh killing the file handle? On the box "uname -a" gives "SunOS... (2 Replies)
Discussion started by: twk
2 Replies

8. UNIX for Dummies Questions & Answers

Explain the line "mn_code=`env|grep "..mn"|awk -F"=" '{print $2}'`"

Hi Friends, Can any of you explain me about the below line of code? mn_code=`env|grep "..mn"|awk -F"=" '{print $2}'` Im not able to understand, what exactly it is doing :confused: Any help would be useful for me. Lokesha (4 Replies)
Discussion started by: Lokesha
4 Replies
Login or Register to Ask a Question
script(1)						      General Commands Manual							 script(1)

NAME
script - make typescript of terminal session SYNOPSIS
[file] DESCRIPTION
makes a typescript of everything printed on your terminal. It starts a shell named by the environment variable, or by default and silently records a copy of output to your terminal from that shell or its descendents, using a pseudo-terminal device (see pty(7)). All output is written to file, or appended to file if the option is given. If no file name is given, the output is saved in a file named The recording can be sent to a line printer later with lp(1), or reviewed safely with the option of cat(1). The recording ends when the forked shell exits (or the user ends the session by typing "exit") or the shell and all its descendents close the pseudo-terminal device. This program is useful when operating a CRT display and a hard-copy record of the dialog is desired. It can also be used for a simple form of session auditing. respects the convention for login shells as described in su(1), sh(1), and ksh(1). Thus, if it is invoked with a command name beginning with a hyphen (that is, passes a basename to the shell that is also preceded by a hyphen. The input flow control can be enabled by setting environmental variable before running Please see section for details on using this envi- ronment variable. EXAMPLES
Save everything printed on the user's screen into file Append a copy of everything printed to the user's screen to file WARNINGS
A command such as which displays the contents of the destination file, should not be issued while executing because it would cause to log the output of the command to itself until all available disk space is filled. Other commands, such as more(1), can cause the same problem but to a lesser degree. records all received output in the file, including typing errors, backspaces, and cursor motions. Note that it does not record typed char- acters; only echoed characters. Thus passwords are not recorded in the file. Responses other than simple echoes (such as output from screen-oriented editors and command editing) are recorded as they appeared in the original session. When there is no input flow control is not set), there can be some data loss while using However, script(1) can behave unexpectedly, if is set and is not set. AUTHOR
was developed by the University of California, Berkeley and HP. script(1)