Sponsored Content
Full Discussion: Limit output in awk
Top Forums Shell Programming and Scripting Limit output in awk Post 302402978 by Franklin52 on Thursday 11th of March 2010 04:07:13 AM
Old 03-11-2010
Code:
awk -F, '{$1=$1}1' OFS="|" file

or:

Code:
sed 's/,/|/g' file

or:

Code:
tr ',' '|' < file

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Is there a way to limit DIFF output

Hello is there a way to limit the number of lines output by the DIFF command? I tried -C 200 ect and -c but it continues to print out the whole huge file. Reason needed is i'm trying to do alot of DIFFs on a long list of files and would like to only get back an indicator which files are... (2 Replies)
Discussion started by: bobk544
2 Replies

2. Shell Programming and Scripting

How to limit output

hello, i'm trying to figure out a way to limit the output from an SQL query that is counting the number of occurances of a value in a field and the problem is when i run this query against a huge file with many unique values the output is pretty huge. Is there a way i can specifically LIMIT the... (2 Replies)
Discussion started by: bobk544
2 Replies

3. Shell Programming and Scripting

awk file size limit

My code is awk '{ out=split(FILENAME,a,"/") sub(/\./,"_",a) sub(/\-/,"_",a) NEWSTRING="main_"a"_"a"(" # The word we want to insert gsub(/main\(/,NEWSTRING); # the word to be replaced print "Main becomes ",NEWSTRING")","in file ",FILENAME >> "/home/ds2/test/NEW2.txt" ... (4 Replies)
Discussion started by: senior_ahmed
4 Replies

4. Shell Programming and Scripting

AWK limit for (length) function?

I am trying to use the following code: awk '{s=$0;if(length(s) < 750){getline; s=s " " $0}printf("%s\n",s)}' filename but an error shows that 'awk' is too long. Is there a limit to the awk length function? and what could be an alternate solution for long fixed width records? The code... (3 Replies)
Discussion started by: CKT_newbie88
3 Replies

5. Shell Programming and Scripting

How to group the output w/ limit

Hi All, Second time to post on this group :) I'm pulling my hair now 'coz I'm so dumb to produce this requirement. Requirement: I want to run a utility by limiting the no. inside my process (mov##) to be able to use in multi streaming. Here is my script: --Input: "user_list.txt"... (0 Replies)
Discussion started by: alvingo
0 Replies

6. Shell Programming and Scripting

Problem with awk awk: program limit exceeded: sprintf buffer size=1020

Hi I have many problems with a script. I have a script that formats a text file but always prints the same error when i try to execute it The code is that: { if (NF==17){ print $0 }else{ fields=NF; all=$0; while... (2 Replies)
Discussion started by: fate
2 Replies

7. Shell Programming and Scripting

AWK Memory Limit ?

Is there an input file memory limit for awk? I have a 38Mb text file that I am trying to print out certatin lines and add a string to the end of that line. When I excute the script on the 38Mb file the string I am adding is put on a new line. If I do the same with a smaller file the... (3 Replies)
Discussion started by: cold_Que
3 Replies

8. UNIX for Dummies Questions & Answers

Limit the number of characters in a bash output

I have a script that outputs the weather on two lines. If possibly I would like to set a character limit on them Currently it outputs something like but I would like to limit the lines so appends an ellipsis if nescessary: This is the script #! /bin/bash curl -s --connect-timeout... (2 Replies)
Discussion started by: Light_
2 Replies

9. UNIX for Dummies Questions & Answers

character limit via awk

I'm using a command that outputs the total size of the files that I've specified. I'd like to introduce a character limit that appends an ellipsis to the lines that go beyond the specified amount. du -chs {query} | sed 's!.*/!!' | awk '{print substr($0,0,25)""}' That's what I have so far.... (4 Replies)
Discussion started by: Light_
4 Replies

10. Shell Programming and Scripting

Limit the number of characters in bash output

Hi, I need some help with this: I'm making a script which does a couple of things with image files. The script is supposed to echo the number of each image it is processing like this: Processing image1.jpgThe problem is with images with very long filenames, so I want to know how to limit the... (5 Replies)
Discussion started by: Shadow_Reaper
5 Replies
ppmtosixel(1)						      General Commands Manual						     ppmtosixel(1)

NAME
ppmtosixel - convert a portable pixmap into DEC sixel format SYNOPSIS
ppmtosixel [-raw] [-margin] [ppmfile] DESCRIPTION
Reads a portable pixmap as input. Produces sixel commands (SIX) as output. The output is formatted for color printing, e.g. for a DEC LJ250 color inkjet printer. If RGB values from the PPM file do not have maxval=100, the RGB values are rescaled. A printer control header and a color assignment table begin the SIX file. Image data is written in a compressed format by default. A printer control footer ends the image file. OPTIONS
-raw If specified, each pixel will be explicitly described in the image file. If -raw is not specified, output will default to com- pressed format in which identical adjacent pixels are replaced by "repeat pixel" commands. A raw file is often an order of magni- tude larger than a compressed file and prints much slower. -margin If -margin is not specified, the image will be start at the left margin (of the window, paper, or whatever). If -margin is speci- fied, a 1.5 inch left margin will offset the image. PRINTING
Generally, sixel files must reach the printer unfiltered. Use the lpr -x option or cat filename > /dev/tty0?. BUGS
Upon rescaling, truncation of the least significant bits of RGB values may result in poor color conversion. If the original PPM maxval was greater than 100, rescaling also reduces the image depth. While the actual RGB values from the ppm file are more or less retained, the color palette of the LJ250 may not match the colors on your screen. This seems to be a printer limitation. SEE ALSO
ppm(5) AUTHOR
Copyright (C) 1991 by Rick Vinci. 26 April 1991 ppmtosixel(1)
All times are GMT -4. The time now is 06:05 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy