Sponsored Content
Top Forums UNIX for Beginners Questions & Answers Concatenate a string and number and compare that with another string in awk script Post 303038204 by rdrtx1 on Tuesday 27th of August 2019 04:49:55 PM
Old 08-27-2019
give space. otherwise it will think it's another variable.

Last edited by rdrtx1; 02-18-2020 at 07:53 PM..
This User Gave Thanks to rdrtx1 For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Concatenate String through Awk

I want to concatenate any particular field of the file with any String say SSB....but i am not able to do it... I hv tried the following code....but its saying there is error in parsing it.. awk 'BEGIN { FS = "," ; OFS = "," ; } { for ( i = 1 ; i < 5 ; i++ ) {a=i;b="SSB"; print $1,$a$b,$3 } }'... (3 Replies)
Discussion started by: monu_munish
3 Replies

2. Shell Programming and Scripting

[awk]compare a number in a string with a list

Hi, I have a program written in awk and I want to extend it to do another task. My program is a list of CVS log reports of a repository. For each file, I have some fields. One of the fields is the comment field. I want to know how I can check if a comment (which is a free text field)... (8 Replies)
Discussion started by: sandeepk1611
8 Replies

3. Shell Programming and Scripting

awk if statement to evaluate string and compare

I have the following simplified code that I am planning on putting into a larger shell script. I have been butchering it to try and make work amongst google searches and reading awk documentation. amixer sset Master toggle | awk '{ if ( /^ Front Left/ { print $7 } == // ) print "MUTED" }'I... (2 Replies)
Discussion started by: jelloir
2 Replies

4. Shell Programming and Scripting

Concatenate lines with unique string AND number

In Bash using AWK or sed I need to convert the following file: ... numitem_tab0 =<p>1 KEYWORD</p><p>2 KEYWORD</p><p>3 KEYWORD</p><p>4 KEYWORD</p><p>5 KEYWORD</p>...<p>25 KEYWORD</p> subitem_tab0 =<p></p><p></p> ... numitem_tab6 =<p>1 KEYWORD</p><p>2 KEYWORD</p><p>3 KEYWORD</p><p>4 KEYWORD</p>... (2 Replies)
Discussion started by: pioavi
2 Replies

5. Shell Programming and Scripting

sed or awk command to replace a string pattern with another string based on position of this string

here is what i want to achieve... consider a file contains below contents. the file size is large about 60mb cat dump.sql INSERT INTO `table1` (`id`, `action`, `date`, `descrip`, `lastModified`) VALUES (1,'Change','2011-05-05 00:00:00','Account Updated','2012-02-10... (10 Replies)
Discussion started by: vivek d r
10 Replies

6. Shell Programming and Scripting

Awk, sed - concatenate lines starting with string

I have a file that looks like this: John Smith http://www.profile1.com http://www.profile2.com http://www.profile3.com Marc Olsen http://www.profile4.com http://www.profile5.com http://www.profile6.com http://www.profile7.com Lynne Doe http://www.profile8.com http://www.profile9.com... (3 Replies)
Discussion started by: locoroco
3 Replies

7. Shell Programming and Scripting

awk - how to compare part of the string?

Need help for awk.. file will have comma separated numbers, I need check digits before 10 numbers eg ( 001)1234567890 Basically want to check country code of a mobile number. eg: abc,def,data, data,0011234567890, data,data Script should be checking country code with 001, I will pass... (10 Replies)
Discussion started by: vegasluxor
10 Replies

8. Shell Programming and Scripting

String compare using awk - what am I doing wrong?

Hi all, I was doing some string manipulation in my script and wanted to try using awk. However, I have been stuck with string compare. A simplified form of my conundrum is given below: The below prints expected result (prints "Completed because that is the second element"): $ echo... (5 Replies)
Discussion started by: faraway
5 Replies

9. Shell Programming and Scripting

Pass column number as variable to awk and compare with a string.

Hi All, I have a file test.txt. Content of test.txt : 1 vinay se 2 kumar sse 4 kishore tl I am extracting the content of file with below command. awk '$2 ~ "vinay" {print $0}' test.txt Now instead of hardcoding $2 is there any way pass $2 as variable and compare with a... (7 Replies)
Discussion started by: Girish19
7 Replies

10. Shell Programming and Scripting

Compare string length to a number

Hi, I want to compare strings length to a number but i am getting error. I want first name should be length of 8. Please help. #bin !/bin/bash clear echo -n "Enter name " read name IFS=_ ary=($name) for key in "${!ary}"; do echo "$key${ary}"; done ##First name should be equal to 8... (8 Replies)
Discussion started by: rajneesh4U
8 Replies
plot(5) 							File Formats Manual							   plot(5)

Name
       plot - graphics interface

Description
       Files in this format are produced by the routines described in and are interpreted for various devices by commands described in

       A  graphics  file  is a stream of plotting instructions.  Each instruction consists of an ASCII letter, usually followed by bytes of binary
       information, executed in order.	A point is designated by 4 bytes representing the x and y values and each value is a signed integer.   The
       last designated point in an or instruction becomes the current point for the next instruction.

       In the following descriptions, the name of the corresponding routine in is enclosed in parenthesis:

	  a (arc)     The  first  4 bytes are the center, the next 4 provide the starting point, and the last 4 bytes designate the end point of a
		      circular arc.  The least significant coordinate of the end point is used only to determine the quadrant.	The arc  is  drawn
		      counter-clockwise.

	  c (circle)  The first 4 bytes provide the center of the circle and the next 2 bytes designate the radius.

	  e (erase)   Start another frame of output.

	  f (linemod) Take  the  following  string, up to a new line, as the style for drawing further lines.  The styles are dotted, solid, long-
		      dashed, shortdashed, and dotdashed.  This is only effective in the following plots: 4014, ver, lvp16, and hp7475a.

	  l (line)    Draw a line from the point designated by the next 4 bytes to the point provided by the following 4 bytes.

	  m (move)    The next 4 bytes provide a new current point.

	  n (cont)    Draw a line from the current point to the point designated by the next 4 bytes. For further information, see

	  p (point)   Plot the point provided by the next 4 bytes.

	  s (space)   The next 4 bytes give the lower left corner of the plotting area.  The following 4 bytes give the upper right  corner.   The
		      plot is magnified or reduced to fit the device as closely as possible.

		      Space  settings  that  fill the plotting area with unity scaling are listed below for devices supported by the filters of In
		      each of the following cases, the plotting area is assumed square; points outside the square can be displayed on devices that
		      have areas which are not square:

			 4014	   space(0, 0, 3120, 3120);
			 ver	   space(0, 0, 2048, 2048);
			 300, 300s space(0, 0, 4096, 4096);
			 450	   space(0, 0, 4096, 4096);
			 aed	   space(0, 0, 511, 482)
			 bitgraph  space(0, 0, 768, 1024)
			 dumb	   space(0, 0, 132, 90)
			 gigi	   space(0, 0, 767, 479)
			 grn	   space(0, 0, 512, 512)
			 hp7221    space(0, 0, 1800, 1800)
			 lvp16	   space(0, 0, 10365, 7962)  (Paper Size: MET A)
				   space(0, 0, 16640, 10365) (Paper Size: MET B)
				   space(0, 0, 11040, 7721)  (Paper Size: US A4)
				   space(0, 0, 16150, 11040) (Paper Size: US A3)
				   space(0, 0, 7721, 7721)   (Default)
			 hp7475a   Same as for lvp16.

	  t (label)   Place  the first character of the following ASCII string on the current point.  This string is terminated by a newline char-
		      acter.

See Also
       graph(1g), plot(1g), plot(3x)

																	   plot(5)
All times are GMT -4. The time now is 12:45 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy