Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Find and Replace random numeric value with non-numeric value Post 302446512 by rdcwayx on Thursday 19th of August 2010 02:35:22 AM
Old 08-19-2010
Quote:
Originally Posted by Bahf1s
---------- Post updated at 11:23 PM ---------- Previous update was at 11:00 PM ----------



The file has 17,000+ records(rows) of data with the following format,

1702938475,SNU022,201004

but the first column number above in red, is different for every row, the 7 numbers that follow 170 are random numbers for each row. So do i still echo that string?
Code:
awk  'BEGIN{FS=OFS=","} /^170/ {$1="ABCDEFG"}1' urfile

This User Gave Thanks to rdcwayx For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Replace spaces with 0's having numeric values.

What could be the regular expression with gsub function in awk to replace all numerics having spaces before to be replaced with 0s? (1 Reply)
Discussion started by: videsh77
1 Replies

2. Shell Programming and Scripting

Perl code to differentiate numeric and non-numeric input

Hi All, Is there any code in Perl which can differentiate between numeric and non-numeric input? (11 Replies)
Discussion started by: Raynon
11 Replies

3. Shell Programming and Scripting

Numeric or not

Is there a simple way of determining whether a command line arguement is numeric or not?? I tried a search and didn't find anything similar... This is the 2nd time I've made this post.... It didn't appear that the first one showed up ?? Sorry if this is a duplicate... (1 Reply)
Discussion started by: harrisjl
1 Replies

4. Shell Programming and Scripting

Numeric or not?

Is there an easy way using a command or other routine for testing whether an argument on the command line is numeric? Just want to validate... I ran a search and didn't find a similar question.... Thx (3 Replies)
Discussion started by: harrisjl
3 Replies

5. Shell Programming and Scripting

Replace variable length numeric string

I have a customer who logged some cc and bank account numbers in their apache logs. I got the cc numbers x'd out with sed -e 's/args=\{16\}/args=XXXXXXXXXXXXXXXX/g' -e 's/cardnum=\{16\}/cardnum=XXXXXXXXXXXXXXXX/g'but that wasn't too difficult due to the value being 16 digits. The bank account... (7 Replies)
Discussion started by: mk4mzid
7 Replies

6. UNIX for Dummies Questions & Answers

SED command to search for numeric and replace

Hi I am very new to linux and scripting. I need to replace numbers abc with number xyz inputting from a reference file. I used the following command - sed "s/$grd/$lab/" , where $grd and $lab comes from reference file. The problem is the above line doesnt take care of space..... (1 Reply)
Discussion started by: ajayh
1 Replies

7. Shell Programming and Scripting

find numeric duplicates from 300 million lines....

these are numeric ids.. 222932017099186177 222932014385467392 222932017371820032 222932017409556480 I have text file having 300 millions of line as shown above. I want to find duplicates from this file. Please suggest the quicker way.. sort | uniq -d will... (3 Replies)
Discussion started by: pamu
3 Replies

8. Shell Programming and Scripting

Find the numeric value in a string and then check the max. value

hi, i have a string " 00000069 ThreadMonitor W WSVR0606W: Thread "WebContainer : 43|null" (00000069) was previously rep orted to be hung but has completed. It was active for approximately 47533430 milliseconds. There is/are 43 thread(s) in tot al in the server that still may be hung." ... (4 Replies)
Discussion started by: lovelysethii
4 Replies

9. Shell Programming and Scripting

UNIX-how to find out the numeric value

Hi All, I need to found the below numeric value using unix(shell) commands in .txt file and its available in root directory. for example: file name is siva.txt and content is Siva_12345_werwerwe,11,22,33 Siva_12346_werwerwe,22,33,44 Siva_12347_werwerwe,55,44,66 for above string i... (2 Replies)
Discussion started by: sivaraman1981
2 Replies

10. UNIX for Beginners Questions & Answers

Replace a numeric values in a certain column

Hi All, I am trying to replace a certain value from one place in a file . In the below file at position 35 I will have 8 I need to modify all 8 in that position to 7 I tried awk '{gsub("8","7",$35)}1' infile > outfile ----> not working sed -i 's/8/7'g' infile --- it is replacing all... (3 Replies)
Discussion started by: arunkumar_mca
3 Replies
GLGETSHADERPRECISION(3G)					  [FIXME: manual]					  GLGETSHADERPRECISION(3G)

NAME
glGetShaderPrecisionFormat - retrieve the range and precision for numeric formats supported by the shader compiler C SPECIFICATION
void glGetShaderPrecisionFormat(GLenum shaderType, GLenum precisionType, GLint *range, GLint *precision); PARAMETERS
shaderType Specifies the type of shader whose precision to query. shaderType must be GL_VERTEX_SHADER or GL_FRAGMENT_SHADER. precisionType Specifies the numeric format whose precision and range to query. range Specifies the address of array of two integers into which encodings of the implementation's numeric range are returned. precision Specifies the address of an integer into which the numeric precision of the implementation is written. DESCRIPTION
glGetShaderPrecisionFormat retrieves the numeric range and precision for the implementation's representation of quantities in different numeric formats in specified shader type. shaderType specifies the type of shader for which the numeric precision and range is to be retrieved and must be one of GL_VERTEX_SHADER or GL_FRAGMENT_SHADER. precisionType specifies the numeric format to query and must be one of GL_LOW_FLOAT, GL_MEDIUM_FLOAT GL_HIGH_FLOAT, GL_LOW_INT, GL_MEDIUM_INT, or GL_HIGH_INT. range points to an array of two integers into which the format's numeric range will be returned. If min and max are the smallest values representable in the format, then the values returned are defined to be: range[0] = floor(log2(|min|)) and range[1] = floor(log2(|max|)). precision specifies the address of an integer into which will be written the log2 value of the number of bits of precision of the format. If the smallest representable value greater than 1 is 1 + eps, then the integer addressed by precision will contain floor(-log2(eps)). ERRORS
GL_INVALID_ENUM is generated if shaderType or precisionType is not an accepted value. COPYRIGHT
Copyright (C) 2010 Khronos Group. This material may be distributed subject to the terms and conditions set forth in the Open Publication License, v 1.0, 8 June 1999. http://opencontent.org/openpub/. [FIXME: source] 05/30/2012 GLGETSHADERPRECISION(3G)
All times are GMT -4. The time now is 03:40 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy