Sponsored Content
Top Forums Shell Programming and Scripting Replace/Remove not specific text in perl Post 302507311 by mrwatkin on Wednesday 23rd of March 2011 12:29:32 PM
Old 03-23-2011
You could use a buffer, chomp until you find the line with the 1000, then delimit by spaces or tabs (whatever the character is):
Code:
while($buffer = <MYFILE>)
{
  chomp($buffer);
  if('1000' eq (substr $buffer,0,4))
  {
     my @array = split /\s/,$buffer;
     print($array[0] . " " . $array[1] . " " . $array[2] . "\n";
  }
}

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

remove specific lines from flat file using perl

Hi, Here is wat im looking for.. i have a flat file which looks like this.. 00 * * * * .. .. * * text text text COL1 COL2 ----- ----- 1 a (12 Replies)
Discussion started by: meghana
12 Replies

2. Shell Programming and Scripting

How to remove the specific lines from file using perl

Can anyone tell me what could be the solution to following : I have one .txt file which contains some "seed" information. This seed may appear multiple time in the file so what I want do is if this seed appears again in the file then that line should be removed. Please provide the script code... (4 Replies)
Discussion started by: dipakg
4 Replies

3. UNIX for Dummies Questions & Answers

search and replace a specific text in text file?

I have a text file with following content (3 lines) filename : output.txt first line:12/12/2008 second line:12/12/2008 third line:Y I would like to know how we can replace 'Y' with 'N' in the 3rd line keeping 1st and 2nd lines same as what it was before. I tried using cat output.txt... (4 Replies)
Discussion started by: santosham
4 Replies

4. UNIX for Dummies Questions & Answers

how to use vi to replace specific line of text only

hi all, i am new bee to Unix. i know how to replace text for range of lines in vi for e.g. replace | with |||| for line 4 through 7 using vi : 4,7s/|/||||/g but i have to replace | with |||| only for line no 4, 7 and 10 using vi only!!! your help will be appreciated! thanks,... (4 Replies)
Discussion started by: pranav.pandya
4 Replies

5. Shell Programming and Scripting

remove and replace text in a file

Hello all, How would I go to a particular line in a file and remove certain text from it and replace with something that I want it to be there. like: file /etc/abc now look for line HOME="/export/xyz" in /etc/abc and then replace with HOME=/"export/xyz1" thanks in advance guys. (1 Reply)
Discussion started by: solaix14
1 Replies

6. Shell Programming and Scripting

Perl use split and remove specific character

i want to split the input by a space and remove specific characters like full stop, comma...... etc. and then save each word in an array. i got something below, but it didn't work. can anyone please help me? Thank you #!/usr/bin/perl -w while (<>) { $line = <>; @word = split(' ',... (6 Replies)
Discussion started by: mingming88
6 Replies

7. Shell Programming and Scripting

Replace text in SPECIFIC multiple files

I have a list of files with different file names and ext that i need replace(saved as file_list.txt.) i just want to replace from a specific file list. i obtain an error saying lint not found. Plz help. Thx perl -e "s/$NAME/$T_NAME/gi;" -pi $(find . -type f | xargs -0 lint -e < file_list.txt) (0 Replies)
Discussion started by: yvmy
0 Replies

8. Shell Programming and Scripting

Help with remove last text of a file that have specific pattern

Input file matrix-remodelling_associated_8_ aurora_interacting_1_ L20 von_factor_A_domain_1 ATP_containing_3B_ . . Output file matrix-remodelling_associated_8 aurora_interacting_1 L20 von_factor_A_domain_1 ATP_containing_3B . . (3 Replies)
Discussion started by: perl_beginner
3 Replies

9. Shell Programming and Scripting

find from file and replace with specific text

Dear All, I do not have any knowledge of scripting. I want to replace specific lines of a text file with a specific text. Like I have one file which is "original file" and one file "changes file" which has list of lines which I want to replace in original file with a specific string. I want the... (5 Replies)
Discussion started by: libras
5 Replies

10. UNIX for Dummies Questions & Answers

How to replace and remove few junk characters from a specific field?

I would like to remove all characters starting with "%" and ending with ")" in the 4th field - please help!! 1412007819.864 /device/services/heartbeatxx 204 0.547%!i(int=0) 0.434 0.112 1412007819.866 /device/services/heartbeatxx 204 0.547%!i(int=1) 0.423 0.123... (10 Replies)
Discussion started by: snemuk14
10 Replies
GLBINDVERTEXBUFFER(3G)						   OpenGL Manual					    GLBINDVERTEXBUFFER(3G)

NAME
glBindVertexBuffer - bind a buffer to a vertex buffer bind point C SPECIFICATION
void glBindVertexBuffer(GLuint bindingindex, GLuint buffer, GLintptr offset, GLintptr stride); PARAMETERS
bindingindex The index of the vertex buffer binding point to which to bind the buffer. buffer The name of an existing buffer to bind to the vertex buffer binding point. offset The offset of the first element of the buffer. stride The distance between elements within the buffer. DESCRIPTION
glBindVertexBuffer binds the buffer named buffer to the vertex buffer binding point whose index is given by bindingindex. offset and stride specify the offset of the first element within the buffer and the distance between elements within the buffer, respectively, and are both measured in basic machine units. bindingindex must be less than the value of GL_MAX_VERTEX_ATTRIB_BINDINGS. offset and stride must be greater than or equal to zero. If buffer is zero, then any buffer currently bound to the specified binding point is unbound. ERRORS
GL_INVAILD_VALUE is generated if bindingindex is greater than or equal to the value of GL_MAX_VERTEX_ATTRIB_BINDINGS. GL_INVALID_VALUE is generated if offset or stride is less than zero. GL_INVALID_VALUE is generated if buffer is not the name of an existing buffer object. GL_INVALID_OPERATION is generated if no vertex array object is bound. ASSOCIATED GETS
glGet() with argument GL_MAX_VERTEX_ATTRIB_BINDINGS. SEE ALSO
glVertexAttribBinding(), glVertexAttribFormat(), glVertexAttribPointer(), glVertexBindingDivisor(). COPYRIGHT
Copyright (C) 2012 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/. AUTHORS
opengl.org opengl.org 06/10/2014 GLBINDVERTEXBUFFER(3G)
All times are GMT -4. The time now is 11:30 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy