Sponsored Content
Full Discussion: awk remove line feed
Top Forums Shell Programming and Scripting awk remove line feed Post 302534945 by aigles on Wednesday 29th of June 2011 08:06:08 AM
Old 06-29-2011
Quote:
Originally Posted by scottn
Code:
$ awk '{printf} !NR%3{print ""}' file
1,2,3,
4,5,6,

Using printf without any argument is dangerous.
If $0 contains format sequence like %s or %d, awk will failed.
An example:
Code:
$ cat in.txt
aaa
bbb
__ %s __
ddd
$ awk '{printf; print "."}' in.txt
aaa.
bbb.
awk: not enough arguments in printf(__ %s __) or sprintf(__ %s __)
 record number 3
$

Allways specify an argument to printf.
Replace :
Code:
printf ;

with
Code:
printf "";

Jean-Pierre.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

need script-remove line feed

hi all, i have csv file with three comma separated columns i/p file First_Name, Address, Last_Name XXX, "456 New albany \n newyork, Unitedstates \n 45322-33", YYY\n ZZZ, "654 rifle park \n toronto, canada \n 43L-w3b", RRR\n is there any way i can remove \n (newline) from the second... (1 Reply)
Discussion started by: gowrish
1 Replies

2. Shell Programming and Scripting

replace last form feed with line feed

Hi I have a file with lots of line feeds and form feeds (page break). Need to replace last occurrence of form feed (created by - echo "\f" ) in the file with line feed. Please advise how can i achieve this. TIA Prvn (5 Replies)
Discussion started by: prvnrk
5 Replies

3. Shell Programming and Scripting

SED remove line feed and add to certain area

Hi All, I have a xml file and requirement is to remove the line feed and add line feed after some element. <?xml version="1.0" ?> <AUDITRECORDS> <CARF> <HED> <VN1>20090616010622</VN1> <VN2>0</VN2> <VN3>1090</VN3> <VN4>CONFIG_DATA</VN4> ... (8 Replies)
Discussion started by: sreejitnair123
8 Replies

4. Shell Programming and Scripting

Remove line feed from csv file column

Hi All, My requirement is to remove line (3 Replies)
Discussion started by: r_t_1601
3 Replies

5. Shell Programming and Scripting

Remove line feed from csv file column

Hi All, i have a csv file . In the 7th column i have data that has line feed in it. Requirement is to remove the line feed from the 7th column whenever it appears There are 11 columns in the file C1,C2,C3,C4,C5,C6,C7,C8,C9,C10,C11 The value in C7 contains line feed ( Alt + Enter ),... (2 Replies)
Discussion started by: r_t_1601
2 Replies

6. Shell Programming and Scripting

awk for replacing line feed

Hello all, I have data like "1"|"My_name"|"My_Email"|"My_Last"|My_other" "2"|"My_name"|"My_Email"|"My_Last"|My_other" "3"|"My_name"|"My_Email"|" "|My_other" "1"|"My_name"|"My_Email"|"My_Last"|My_other" Need output like "1"|"My_name"|"My_Email"|"My_Last"|My_other"... (10 Replies)
Discussion started by: lokaish23
10 Replies

7. Shell Programming and Scripting

Want to remove a line feed depending on number of tabs in a line

Hi! I have been struggling with a large file that has stray end of line characters. I am working on a Mac (Lion). I mention this only because I have been mucking around with fixing my problem using sed, and I have learned far more than I wanted to know about Unix and Mac eol characters. I... (1 Reply)
Discussion started by: user999991
1 Replies

8. Shell Programming and Scripting

awk issue splitting a fixed-width file containing line feed in data

Hi Forum. I have the following script that splits a large fixed-width file into smaller multiple fixed-width files based on input segment type. The main command in the script is: awk -v search_col_pos=$search_col_pos -v search_str_len=$search_str_len -v segment_type="$segment_type"... (8 Replies)
Discussion started by: pchang
8 Replies

9. Shell Programming and Scripting

Remove line feed in data

Please use code tags for sample data Hi I have a file where there are line feeds in the data. I am not able to read the file from an application. I exported this data from Access database and many columns contain line feed. My data looks like this abcd,efgh,ijkl,mnop abcd,ef... (7 Replies)
Discussion started by: dnat
7 Replies

10. UNIX for Beginners Questions & Answers

awk Command to add Carriage Return and Line Feed

Hello, Can someone please share a Simple AWK command to append Carriage Return & Line Feed to the end of the file, If the Carriage Return & Line Feed does not exist ! Thanks (16 Replies)
Discussion started by: rosebud123
16 Replies
PCLOCK(1)						      General Commands Manual							 PCLOCK(1)

NAME
pclock - pixmap clock SYNOPSIS
pclock [options] DESCRIPTION
This manual page documents briefly the pclock command. This manual page was written for the Debian GNU/Linux distribution because the original program does not have a manual page. pclock is a program that places a small analog clock program on the desktop of X. It was designed to run under the WindowMaker window man- ager. It uses any 64x64 pixmap as a background. OPTIONS
The programs follow the usual GNU command line syntax, with long options starting with two dashes (`-') and short optoins starting with one dash. A summary of options is included below. -B PIXMAP, --background=PIXMAP Use the given pixmap as the clock background (size must be 64x64). -H COLOR, --hands-color=COLOR Draw the hands (hour, minute and second) in the specified color. -S COLOR, --second-hand-color Draw the second hand in the specified color -h, --help Show summary of options. --hour-hand-length=INT Draw the hour hand with the specified length of INT. --minute-hand-length=INT Draw the minute hand with the specified length of INT. --second-hand-length=INT Draw the second hand with the specified length of INT. --second-hand-width=INT Draw the minute hand with the specified width of INT. -s, --second-hand Don't display the second hand. -v, --version Show version of program. -w, --withdrawn Don't start up in a withdrawn (iconic) state. AUTHOR
This manual page was written by Darren Benham <gecko@debian.org>, for the Debian GNU/Linux system (but may be used by others). The soft- ware is copyrighted (c) 1998 by and released under the GPL v2. Author: Alexander Kourakos <Alexander@Kourakos.com> Web: http://www.kourakos.com/~awk/pclock/ PCLOCK(1)
All times are GMT -4. The time now is 11:25 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy