11-13-2012
Thanks, this shows the power of awk
Works fine as long as its number.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi All;
Having a problem with a file..
the file contains the following data... (a snapshot)
1331F9E9DB7C2BB80EAEDE3A8F043B94,AL7 1DZ,M,50
186FDF93E1303DBA217279EC3671EA91,NG5 1JU,M,24
3783FFAF602015056A8CD21104B1AAAF,CH42 4NQ,M,17
It has 3 columns sepreated by a ,
the second column... (7 Replies)
Discussion started by: Zak
7 Replies
2. Shell Programming and Scripting
'String' file contains the following contents,
D11, D31, D92, D29, D24,
using ksh, I want to remove all white spaces between characters no matter how long the string is.
Would you please give me some help? (1 Reply)
Discussion started by: yoonius
1 Replies
3. Shell Programming and Scripting
Hi,
What sed command (if sed is the right command) can remove ALL white space from my file. I have a csv, except I want to remove all white space between commas and characters.
My idea (without testing)
sed 's/ //g'
Is there a better way? (18 Replies)
Discussion started by: mcclunyboy
18 Replies
4. Shell Programming and Scripting
Hi,
I have a large flat file from host without delimiter. I'm transforming this file to a csv file using statements like
# Row 03: Customer / field position 3059 +20
WOFABNAM=substr( $0, 3059, 20 );
and deleting the trailing whitespaces before and after with that
sub( /^ +/, "",... (4 Replies)
Discussion started by: Celald
4 Replies
5. UNIX for Dummies Questions & Answers
Hi,
I have a file that contains whitespaces with spaces and spaces and tabs on each line and am wanting to remove the whitespaces. My version of sed is one that does not recognize \t etc.
The sed and awk one-liners below that I found via Google both does not work.
So my next best... (3 Replies)
Discussion started by: newbie_01
3 Replies
6. Shell Programming and Scripting
I have an AWK script that uses multiple delimiters in the FS variable.
FS="+"
My awk script takes a file name such as this:
12345_smith_bubba_12345_20120215_4_0.pdf and parses it out based on the under score. Each parsed field then has some code for data validation etc.
This script has... (12 Replies)
Discussion started by: reno4me
12 Replies
7. Shell Programming and Scripting
Hi,
I'm fairly new to scripting and I have a problem that I am having difficulty solving.
What I'd like to do is run an awk script to adjust the string in the first field depending on the string in another field. This is best explained with an example:
Here is my script:
cat... (4 Replies)
Discussion started by: calbrex
4 Replies
8. Shell Programming and Scripting
Hi,
Consider the data (FS = |):
1| England |end
2| New Zealand |end
3|Australia|end
4| Some Made Up Country |end
5| West Indies|end
I want the output to be (i.e. without the leading and trailing white space from $2)
England
New Zealand
Australia
Some Made Up Country
West... (4 Replies)
Discussion started by: Storms
4 Replies
9. Shell Programming and Scripting
hi guys
how can i add spacein file name with sed if strings have no space around dash
input
19-20
( 18-19 )
ABC-EFG
output after add white space
19 - 20
(18 - 19 )
ABC - EFG
thx in advance (2 Replies)
Discussion started by: mhs
2 Replies
10. Shell Programming and Scripting
I am trying to remove whitespaces from a file containing sample data as:
457 <EOFD> Mar 1 2007 12:00:00:000AM <EOFD> Mar 31 2007 12:00:00:000AM <EOFD> system <EORD> 458 <EOFD> Mar 1 2007 12:00:00:000AM<EOFD>agf <EOFD> Apr 20 2007 9:10:56:036PM <EOFD> prodiws<EORD> . Basically these... (11 Replies)
Discussion started by: amvip
11 Replies
LEARN ABOUT LINUX
ppmdither
ppmdither(1) General Commands Manual ppmdither(1)
NAME
ppmdither - ordered dither for color images
SYNOPSIS
ppmdither [-dim power] [-red shades] [-green shades] [-blue shades] [ppmfile]
DESCRIPTION
Reads a portable pixmap as input, and applies dithering to it to reduce the number of colors used down to the specified number of shades
for each primary. The default number of shades is red=5, green=9, blue=5, for a total of 225 colors. To convert the image to a binary rgb
format suitable for color printers, use -red 2 -green 2 -blue 2.
OPTIONS
-dim power The size of the dithering matrix. The dithering matrix is a square whose dimension is a power of 2. power is that power of
2. The default is 4, for a 16 by 16 matrix.
-red shades The number of red shades to be used, including black; minimum of 2.
-green shades The number of green shades to be used, including black; minimum of 2.
-blue shades The number of blue shades to be used, including black; minimum of 2.
SEE ALSO
pnmdepth(1), ppmquant(1), ppm(5)
AUTHOR
Copyright (C) 1991 by Christos Zoulas.
14 July 1991 ppmdither(1)