Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Entering a newline into a header in awk Post 302905914 by Akshay Hegde on Monday 16th of June 2014 04:21:02 AM
Old 06-16-2014
This can also be done without awk

Try :

Code:
$ echo "Your Header" | cat - inputfile  > outputfile

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Awk error for joining records with CR/newline

Is there any way to remove carriage retuns between the records? These carriage returns are created in an excel cell by using Alt+enter, this is similar to new line... We have input records separated by TABS and have carriage returns as below: 123 456 789 ABC "1952.00" 678 "abcdef ghik... (5 Replies)
Discussion started by: acheepi
5 Replies

2. Shell Programming and Scripting

using awk removing newline and specific position

Hello Friends, Input File looks as follows: >FASTA Header1 line1 line2 line3 linen >FASTA Header2 Line1 Line2 linen >FASTA Header3 and so on ....... Output: Want something as: >FASTA Header1 line1line2line3linen >FASTA Header2 (5 Replies)
Discussion started by: Deep9000
5 Replies

3. Shell Programming and Scripting

sed/awk remove newline

Hi, I have input file contains sql queries i need to eliminate newlines from it. when i open it vi text editor and runs :%s/'\n/'/g it provides required result. but when i run sed command from shell prompt it doesn't impact outfile is still same as inputfile. shell] sed -e... (6 Replies)
Discussion started by: mirfan
6 Replies

4. Shell Programming and Scripting

awk puts newline between fields

I have a='123, abc, def, ghi' var1=`echo $a | awk -F", " '{print RS $1}'` echo "something: $var1" which outputs something 123 how can I tell awk not to put a newline between fields? I want it to output: something: 123 (4 Replies)
Discussion started by: unclecameron
4 Replies

5. Shell Programming and Scripting

AWK Script Issue insert newline for a regular expression match

Hi , I am having an issue with the Awk script to insert newline for a regular expression match Having a file like this FILE1 #################### RXOER , RXERA , RXERC , RXERD .RXEA(RXBSN), RXERD , REXCD input RXEGT buffer RXETRY ####################### Want to match the RXE... (38 Replies)
Discussion started by: jaita
38 Replies

6. Solaris

Login delay after entering id (40 secs) same after entering pw

Hi all, I have just installed Solaris 10 on an old Fujitsu Primepower 650 which has been wiped clean. I haven't installed anything apart from the OS yet, so the machine is 99% idle. I get long delays when logging in, first after entering the id then another long delay after entering a valid... (8 Replies)
Discussion started by: longjon
8 Replies

7. Shell Programming and Scripting

Error awk: 0602-592 cannot contain a newline character

Hi guys, I'am new at this forum as well as with unix. currently iam trying to create a unix script that will write certain string of words into a file depending on certain conditions apparently i am having problems in terms of writing into the file using the awk. it returns an error ... (0 Replies)
Discussion started by: jihmantiquilla
0 Replies

8. Shell Programming and Scripting

awk: printing newline with last column

I was trying to simplify this from what I'm actually doing, but I started getting even more confused so I gave up. Here is the content of my input file: Academic year,Term,Course name,Period,Last name,Nickname 2012-2013,First Semester,English 12,7th Period,Davis,Lucille When I do this: ... (3 Replies)
Discussion started by: nextyoyoma
3 Replies

9. Shell Programming and Scripting

awk delete newline after other replacements

Dear All, could you please help me to remove \n characters after all other replacements have been done as in the code below: { #remove punctuation and starting whitespaces gsub("]"," "); $1=$1; } { #print lines containing 'whatever' if ($1=="whatever") {print} #print... (3 Replies)
Discussion started by: shivacoder
3 Replies

10. Shell Programming and Scripting

Use awk to turn character to newline then scan output

i have a datafile (data.txt) that has the following data: #Beginner`echo... (4 Replies)
Discussion started by: SkySmart
4 Replies
Gtk2::SourceView2::PrintCompositor(3pm) 		User Contributed Perl Documentation		   Gtk2::SourceView2::PrintCompositor(3pm)

NAME
Gtk2::SourceView2::PrintCompositor HIERARCHY
Glib::Object +----Gtk2::SourceView2::PrintCompositor METHODS
printcompositor = Gtk2::SourceView2::PrintCompositor->new ($buffer) o $buffer (Gtk2::SourceView2::Buffer) printcompositor = Gtk2::SourceView2::PrintCompositor->new_from_view ($view) o $view (Gtk2::SourceView2::View) string = $compositor->get_body_font_name $compositor->set_body_font_name ($font_name) o $font_name (string) double = $compositor->get_bottom_margin ($unit) o $unit (Gtk2::Unit) $compositor->set_bottom_margin ($margin, $unit) o $margin (double) o $unit (Gtk2::Unit) buffer = $compositor->get_buffer $compositor->draw_page ($context, $page_nr) o $context (Gtk2::PrintContext) o $page_nr (integer) string = $compositor->get_footer_font_name $compositor->set_footer_font_name ($font_name) o $font_name (string or undef) $compositor->set_footer_format ($separator, $left, $center, $right) o $separator (boolean) o $left (string or undef) o $center (string or undef) o $right (string or undef) string = $compositor->get_header_font_name $compositor->set_header_font_name ($font_name) o $font_name (string or undef) $compositor->set_header_format ($separator, $left, $center, $right) o $separator (boolean) o $left (string or undef) o $center (string or undef) o $right (string or undef) boolean = $compositor->get_highlight_syntax $compositor->set_highlight_syntax ($highlight) o $highlight (boolean) double = $compositor->get_left_margin ($unit) o $unit (Gtk2::Unit) $compositor->set_left_margin ($margin, $unit) o $margin (double) o $unit (Gtk2::Unit) string = $compositor->get_line_numbers_font_name $compositor->set_line_numbers_font_name ($font_name) o $font_name (string or undef) integer = $compositor->get_n_pages boolean = $compositor->paginate ($context) o $context (Gtk2::PrintContext) double = $compositor->get_pagination_progress boolean = $compositor->get_print_footer $compositor->set_print_footer ($print) o $print (boolean) boolean = $compositor->get_print_header $compositor->set_print_header ($print) o $print (boolean) integer = $compositor->get_print_line_numbers $compositor->set_print_line_numbers ($interval) o $interval (integer) double = $compositor->get_right_margin ($unit) o $unit (Gtk2::Unit) $compositor->set_right_margin ($margin, $unit) o $margin (double) o $unit (Gtk2::Unit) integer = $compositor->get_tab_width $compositor->set_tab_width ($width) o $width (integer) double = $compositor->get_top_margin ($unit) o $unit (Gtk2::Unit) $compositor->set_top_margin ($margin, $unit) o $margin (double) o $unit (Gtk2::Unit) wrapmode = $compositor->get_wrap_mode $compositor->set_wrap_mode ($wrap_mode) o $wrap_mode (Gtk2::WrapMode) PROPERTIES
'body-font-name' (string : default undef : readable / writable) Name of the font to use for the text body (e.g. "Monospace 10") 'buffer' (Gtk2::SourceView2::Buffer : default undef : readable / writable / construct-only) The GtkSourceBuffer object to print 'footer-font-name' (string : default undef : readable / writable) Name of the font to use for the page footer (e.g. "Monospace 10") 'header-font-name' (string : default undef : readable / writable) Name of the font to use for the page header (e.g. "Monospace 10") 'highlight-syntax' (boolean : default true : readable / writable) Whether to print the document with highlighted syntax 'line-numbers-font-name' (string : default undef : readable / writable) Name of the font to use for the line numbers (e.g. "Monospace 10") 'n-pages' (integer : default -1 : readable) The number of pages in the document (-1 means the document has not been completely paginated). 'print-footer' (boolean : default false : readable / writable) Whether to print a footer in each page 'print-header' (boolean : default false : readable / writable) Whether to print a header in each page 'print-line-numbers' (Glib::UInt : default 1 : readable / writable) Interval of printed line numbers (0 means no numbers) 'tab-width' (Glib::UInt : default 8 : readable / writable) Width of a tab character expressed in spaces 'wrap-mode' (Gtk2::WrapMode : default "none" : readable / writable) Whether to wrap lines never, at word boundaries, or at character boundaries. ENUMS AND FLAGS
enum Gtk2::Unit o 'pixel' / 'GTK_UNIT_PIXEL' o 'points' / 'GTK_UNIT_POINTS' o 'inch' / 'GTK_UNIT_INCH' o 'mm' / 'GTK_UNIT_MM' enum Gtk2::WrapMode o 'none' / 'GTK_WRAP_NONE' o 'char' / 'GTK_WRAP_CHAR' o 'word' / 'GTK_WRAP_WORD' o 'word-char' / 'GTK_WRAP_WORD_CHAR' SEE ALSO
Gtk2::SourceView2, Glib::Object COPYRIGHT
Copyright (C) 2009 by Emmanuel Rodriguez perl v5.14.2 2011-11-16 Gtk2::SourceView2::PrintCompositor(3pm)
All times are GMT -4. The time now is 08:52 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy