Sponsored Content
Top Forums Shell Programming and Scripting Add missing linefeeds between formfeeds in reports Post 302646217 by Scrutinizer on Thursday 24th of May 2012 06:01:26 PM
Old 05-24-2012
awk on HPUX is POSIX compliant and so should be based on nawk. Some awks for some reason need to have the fields recalculated first ($1=$1). Combining this with Corona688's suggestion, try this:
Code:
awk '{$1=$1}NF=65' FS='\n' OFS='\n' RS='\f' ORS='\f'

I did not use a newline in ORS, since I think 65 lines per pages, should mean 64 newlines characters before the form feed, no?

-- edit --
OK, I noticed that the message indicates the the record can not be longer than 3000, that means we probably cannot use a form feed as a record separator for that reason...

Last edited by Scrutinizer; 05-24-2012 at 07:11 PM..
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

i need to add missing delimiters...

ladies, gents.. say i have a file that should have 10 fields... (9 delimiters) some records have 10 fields, some have 5 some have 8, etc.. nothing consistent, but i need my file to have 9 delimiters on each line, even if its null fields.. how can i go line by line and add the correct... (2 Replies)
Discussion started by: obarrett
2 Replies

2. Shell Programming and Scripting

Add missing times

Not sure about the title if someone has a better name for it please lemme know and I will edit the title. I have several (10+ files) which look something like: File 1: 12/28/2009 04:0 8 12/28/2009 04:4 4 12/28/2009 05:0 4 . . . File 2: 12/28/2009 04:1 7 12/28/2009 04:2 3... (2 Replies)
Discussion started by: jstrangfeld
2 Replies

3. Shell Programming and Scripting

Help with removing embedded linefeeds

Greetings all, i have csv file with pipe separated columns SSN|NAME|ADDRESS|FILLER 123|abc|myaddress|xxx 234|BBB|my add ress broken up|yyy In the example above, the second record is broken into multiple lines. I need to keep going until I find a "|" since this issue is with the... (14 Replies)
Discussion started by: stayalive
14 Replies

4. UNIX Desktop Questions & Answers

merging files and add missing rows

hello all, I have files that have a specific way for naming the first column they are make of five names in Pattern of 3 Y = (no case sensitive) so the files are names $Y-$Y-$Y or $X-$Y-$Z depending how we look they only exist of the pattern exist now I want to create a file from them that... (9 Replies)
Discussion started by: A-V
9 Replies

5. Solaris

[solved]Config/enable_mapping missing, how to add?

Issue resolved by upgrading from solaris 11 to solaris 11.1 I would like to enable network mapping. While using instructions from: https://blogs.oracle.com/VDIpier/entry/solaris_11_changing_the_hostname To change my hostname I noticed I am missing the enable mapping bool. What it should... (0 Replies)
Discussion started by: taltamir
0 Replies

6. SuSE

How to resolve missing missing dependencies with opensuse 11.3 and 12.3?

Hello, This is a programming question as well as a suse question, so let me know if you think I should post this in programming. I have an application that I compiled under opensuse 12.2 using g77-3.3/g++3.3. The program compiles and runs just fine. I gave the application to a colleague who... (2 Replies)
Discussion started by: LMHmedchem
2 Replies

7. Shell Programming and Scripting

WARNING! 16126 bare linefeeds received in ASCII mode

I am doing FTP from a server and getting below ERROR:WARNING! 16126 bare linefeeds received in ASCII mode File may not have transferred correctly. I looked into web and found that I may need to change the mode to binary, but when I do so the records are not in readable format...So need the file... (10 Replies)
Discussion started by: joshilalit2004
10 Replies

8. Shell Programming and Scripting

How to add missing value?

Hi Gurus, I have a txt file. some record missed 2nd colum value, I need put default value into the file. ex: below file, first 4 records, missed one column (only 4 columns. it should be 5) $cat missedfield aaa,bbb,ccc,fff aaa,bbb,ccc,ddd 111,222,333,444 111,222,333,444... (3 Replies)
Discussion started by: ken6503
3 Replies

9. Shell Programming and Scripting

Add word for a missing column

Hi team... I need some help/advise on adding a word for a missing column. I have a file as below. Rep N1 Forever Limited 2015 Rep N2 Limited 2016 since 2nd content is 3 lines missing one line so i need to make this like Rep N1 Forever (3 Replies)
Discussion started by: newbee5
3 Replies

10. Shell Programming and Scripting

How to add missing date and time in a bash script?

Hi Again, I have a file that contains date and time for the past 2 hours. What i need is add missing date and time in a file. INPUT 2016-01-13 01:33 10 2016-01-13 01:31 10 2016-01-13 01:30 10 2016-01-13 01:29 10 2016-01-13 01:28 10 2016-01-13 01:27 10 2016-01-13 01:26 10 2016-01-13... (14 Replies)
Discussion started by: ernesto
14 Replies
VTPRINT(1)						      General Commands Manual							VTPRINT(1)

NAME
vtprint - print files from UNIX host to printer attached to local terminal SYNOPSIS
vtprint [ -bBcCdDeEfFhlnNqQtvw ] [ -L vtprintcap ] [ -T termtype ] [ -V device ] [ filename... ] DESCRIPTION
vtprint is a simple filter that prints ASCII text to a printer connected to a terminal or terminal emulator. It uses terminal escape sequences to print, and can substitute for lpr(1) in circumstances where the printer is not connected directly to the host or available via TCP/IP. OPTIONS
-b Causes vtprint to open the output stream in binary modes, overriding any automatic postprocessing done by the host (e.g. CR/LF translations). This has no effect if the output stream is not a tty device. -B Undoes the effect of the -b option. Note that this does not open the output stream in text mode if it would not normally be opened in that mode. -c Causes vtprint to append any linefeeds (ASCII 0xA) with carriage returns (ASCII 0xD). This is useful for printing data from a UNIX or similiar host to an MS-DOS system's printer that expects CR/LF line termination. -C Causes vtprint to pass all carriage returns and linefeeds unmodified. -d Use the tty device file instead of stdout for output. This is defined as /dev/tty on this system. (This is operating system spe- cific and may vary from system to system.) This is useful for using vtprint as a pipe called by programs that suppress or redirect the stdout stream of the pipe or printing process. -D Use the stdout stream for output, rather than a tty device file. -e Forces vtprint to ignore the TERM environment variable and use the builtin control codes instead. -E Undoes the effect of the -e option, which allows vtprint to attempt to find an entry in /etc/vtprintcap for the TERM value and use the corresponding control codes. -f Requests vtprint to suppress inclusion of formfeeds (ASCII 0xC) between multiple files. Note that this has no affect on any form- feeds that may be present in the input files already. -F Requests vtprint to include formfeeds between multiple files specified on the command-line and at the end of the last file printed. -h Print out a simple usage message. -l Print out the vtprint license agreement. -L vtprintcap Specifies an alternate file to use instead of /etc/vtprintcap. -n Causes vtprint to strip the CR from any CR/LF sequences. This will not affect handling of any CRs present elsewhere in the file. -N Causes vtprint to pass all carriage returns and linefeeds unmodified. -q Quiet mode. Suppress various status messages from being displayed, useful in situations where vtprint is used as part of a shell script, for example. -Q Cancels the effect of the -q option, allowing normal progress reporting to occur. -t Force the use of the TERM variable to perform a look up of the control sequences to be used in /etc/vtprintcap. If an entry in that file can't be found, vtprint will abort with an error. -T termtype Use the value of termtype instead of the value of the TERM environment variable when performing lookups in /etc/vtprintcap. -v Display version information. -V device Specifies an alternate device file instead of /dev/tty to use. -w Display important warranty waiver information. NO WARRANTY! -- This option changes no special operational parameters of vtprint. But it does indicate to the program that all of the command-line arguments which follow are to be parsed as filenames, even if they begin with a dash. Hence to process a single file with the name "file" you would call vtprint as " vtprint -- -file". ENVIRONMENT
TERM the type of the terminal vtprint will assume is being used. VTPRINT string of options to be used by vtprint. AUTHOR
vtprint was written by Garrett D'Amore, on December 27, 1993 and last modified on October 25, 1994. It is heavily derived from a similar program, called lprint, by the same author. He can be reached via Internet e-mail at garrett@sciences.sdsu.edu. DISTRIBUTION
The latest version of vtprint can be obtained by anonymous ftp at ftp.sdsu.edu in the /pub/vtprint directory. Please read the INDEX and README files before downloading. If you do not have ftp availability, then you can request a uuencoded copy of vtprint be sent to you via e-mail from the author. The author is also willing to make other arrangements as needed, within certain limitations. MAILING LIST
A mailing list for the discussion of topics related to and about vtprint exists. To subscribe to this mailing list, send a message to "vtprint-request@sdsu.edu" with the word "subscribe" as the body. An automated list server will reply with information about the mailing list. COPYRIGHT
vtprint is copyrighted 1994, by Garrett D'Amore. It may be freely redistributed or modified, so long as this and any other copyright notices are included in their original form with the program. The user is granted the right to use this program without limitation. DISCLAIMER
vtprint is provided WITHOUT WARRANTY. The user agrees to indemnify the author from any claims of damage or loss arising from the use of or inability to use this program. In other words, USE AT YOUR OWN RISK! CAVEATS
vtprint cannot be used to print files containing non-printable characters, as these may cause conflicts with the terminal or emulator used. When used over a serial (modem) connection, vtprint may not work properly unless hardware (CTS/RTS) flow control is used. This is due to the fact that most printers are slower than serial connections in common use. vtprint uses terminal escape sequences to print, and not all terminal emulators support these sequences, and of those that do, some support it differently. You can find a listing of some of the programs known to work and not to work with vtprint in the file COMPAT. The best thing to do is try your particular emulator, and find out if it works. The author would appreciate any reports of success or failure, or strange behavior. You can send those to him via Internet e-mail. (See the AUTHOR chapter for how to reach him.) The /etc/vtprintcap file is still largely incomplete. The author would very much appreciate it if individuals with more information dif- ferent terminals would get in contact with him so that support can be added for these terminals in the master archive. Do not background this program, as it has no way of knowing when it is in the background and when it is in the foreground. This will result in your foreground process' output being printed as well as the output from vtprint. FILES
/etc/vtprintcap TODOS
Fix any bugs present, clean-up the documentation, continue to build upon entries in the COMPAT and /etc/vtprintcap files, and finally, finish getting a college education! BUGS
vtprint doesn't handle some signals properly, especially the SIGKILL and SIGSTOP signals, which can't be caught anyway. Also it doesn't check to see if you have backgrounded the process. The resulting condition may leave all output directed to the printer instead of the screen. The fix for this condition is to run the provided vtprtoff program with no arguments, which will restore normal screen output. (You probably won't be able to see what you're typing while you start vtprtoff from the shell.) SEE ALSO
lpr(1), vtprintcap(5), vtprtoff(1) vtprint v2.0.2 25 October 1994 VTPRINT(1)
All times are GMT -4. The time now is 07:44 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy