Sponsored Content
Top Forums Shell Programming and Scripting AWK line by line instead of field by field? Post 77275 by jim mcnamara on Wednesday 6th of July 2005 05:44:04 PM
Old 07-06-2005
Change $7 to $0 -- $0 is the whole line
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

awk append to one line if first field is the same

Hi all, How would I append the second field each time to one line if the first field is the same for example I have this data: 10430,187976 10430,251588 10430,262904 10430,275008 10430,279892 10430,275008 10430,303740 10430,318136 10430,336988 10430,350324 10430,373648 And I... (4 Replies)
Discussion started by: borderblaster
4 Replies

2. UNIX for Advanced & Expert Users

awk for a line that contains someting in a field

How would I do something like this when field 4 contains "John". I only want to print field 1 and 4 when when field 4 contains"John". awk -F" " '{print $1 $4} (3 Replies)
Discussion started by: cokedude
3 Replies

3. Shell Programming and Scripting

Replace line and field using SED and/or AWK or some other suggestion

QUESTION 1: How do you replace a specific line (i.e. line 4) with a new user defined line (i.e. the contents of SAMS’s name, history, math and English grades have been set already). I have been attempting to use SED (FYI: I don’t have GNU SED) or AWK, but haven’t had any luck. FYI: I am using... (1 Reply)
Discussion started by: thibodc
1 Replies

4. Shell Programming and Scripting

Compare Field in Current Line with Field in Previous

Hi Guys I have the following file Essentially, I am trying to find the right awk/sed syntax in order to produce the following 3 distinct files from the file above: Basically, I want to print the lines of the file as long as the second field of the current line is equal to the... (9 Replies)
Discussion started by: moutaye
9 Replies

5. Shell Programming and Scripting

sed to replace a field from a line with another field

i have something like this, cat filename.txt hui this si s"dfgdfg" omeone ipaddress="10.19.123.104" wel hope this works i want to replace only 10.19.123.104 with different ip say 10.19.123.103 i tried this sed -i "s/'ipaddress'/'ipaddress=10.19.123.103'/g" filename.txt ... (1 Reply)
Discussion started by: vivek d r
1 Replies

6. UNIX for Dummies Questions & Answers

Values with common field in same line with awk

Hi all ! I almost did it but got a small problem. input: cars red cars blue cars green truck black Wanted: cars red-blue-green truck black Attempt: gawk 'BEGIN{FS="\t"}{a = a (a?"-":"")$2; $2=a; print $1 FS $2}' input But I also got the intermediate records... (2 Replies)
Discussion started by: beca123456
2 Replies

7. UNIX for Dummies Questions & Answers

Help with awk, where line length and field position are variable

I have several questions about using awk. I'm hoping someone could lend me a hand. (I'm also hoping that my questions make sense.) I have a file that contains pipe separated data. Each line has similar data but the number of fields and the field position on each line is variable. ... (3 Replies)
Discussion started by: Cheese64
3 Replies

8. Shell Programming and Scripting

Command/script to match a field and print the next field of each line in a file.

Hello, I have a text file in the below format: Source Destination State Lag Status CQA02W2K12pl:D:\CAQA ... (10 Replies)
Discussion started by: pocodot
10 Replies

9. Shell Programming and Scripting

awk to remove line if field has symbols in it

Trying to use awk to remove a line only if $1 contains either ; or :. Thje awk below runs but no lines are removed. Thank you :). awk awk '$1 !~ /;/ || $1 !~ /:/ { print }' file file AARS2;TMEM151B 1 AASS 2 ABAT 3 ABCA1 3 ABCA10 1 ABCA12 2 ABCA13 1 ABCA13:AX746840 2 ABCA2 5 (5 Replies)
Discussion started by: cmccabe
5 Replies

10. Shell Programming and Scripting

Printing string from last field of the nth line of file to start (or end) of each line (awk I think)

My file (the output of an experiment) starts off looking like this, _____________________________________________________________ Subjects incorporated to date: 001 Data file started on machine PKSHS260-05CP ********************************************************************** Subject 1,... (9 Replies)
Discussion started by: samonl
9 Replies
img2txt(1)						      General Commands Manual							img2txt(1)

NAME
img2txt - convert images to various text-based coloured files SYNOPSIS
img2txt [ -W width ] [ -H height ] [ -x font-width ] [ -y font-height ] [ -b brightness ] [ -c contrast ] [ -g gamma ] [ -d dither ] [ -f format ] FILE DESCRIPTION
img2txt converts images to colour ASCII characters and outputs them to text-based coloured files. img2txt can load the most widespread image formats: PNG, JPEG, GIF, PNG, BMP etc (see NOTES for details). By default the output text is 60 columns wide, and the line count is computed accordingly to respect aspect ratio of original file. The default output format is standard ANSI coloured text. OPTIONS
-W, --width=<width> Change output column count. If not given, the default is set to 60. -H, --height=<height> Change output line count. If not given, the height is computed to match correct aspect ratio. -x, --font-width=<width> Change output font width. If not given, the default is set to 6. This value will be used for computing aspect ratio. -y, --font-height=<height> Change output font height. If not given, the default is set to 10. This value will be used for computing aspect ratio. -b, --brightness=<brightness> Change image brightness. Default to 1.0. -c, --contrast=<contrast> Change image contrast. Default to 1.0. -g, --gamma=<gamma> Change image gamma. Default to 1.0. -d, --dither=<dither> Change dithering algorithm. This can be one of the following (default to fstein) : none : Nearest color ordered2 : Ordered 2x2 ordered4 : Ordered 4x4 ordered8 : Ordered 8x8 random : Random fstein : Floyd Steinberg -f, --format=<format> Change output format. This can be one of the following (default to ansi) : ansi : coloured ANSI caca : internal libcaca format utf8 : UTF8 with CR utf8cr : UTF8 with CRLF (MS Windows) html : HTML with CSS and DIV support html3 : Pure HTML3 with tables irc : IRC with ctrl-k codes bbfr : BBCode (French) ps : Postscript svg : Scalable Vector Graphics tga : Targa Image -h, --help Display help message and exit. -v, --version Display version of the program and exit. EXAMPLES
img2txt hello.jpg > hello.ans img2txt --width=40 --format=svg hello.jpg > tinyhello.svg NOTES
Setting both column and line count (using --width and --height) will let you choose the exact output size without taking aspect ratio in account. You must compile libcaca package with support of Imlib2 to be able to load a wide variety of image formats. Otherwise you will only be able to load regular BMP files. SEE ALSO
cacaview(1) AUTHOR
This manual page was written by Sam Hocevar <sam@hocevar.net> and Jean-Yves Lamoureux <jylam@lnxscene.org>. libcaca 2007-11-07 img2txt(1)
All times are GMT -4. The time now is 04:16 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy