Sponsored Content
Top Forums Shell Programming and Scripting Problem in deleting lines from the file Post 302360204 by rajeshorpu on Thursday 8th of October 2009 10:11:42 AM
Old 10-08-2009
Problem in deleting lines from the file

Hi All

I am not able to delete few line from long file.

I have a big file which is of 53998 B in size i want to delete lines starting from 32768 to 53998 and collect remaining file in new file.

It is giving exception
sed: command garbled: 32768,$countd

Please find the sample script below

#!/bin/ksh
cd /usr/home/dfusr/backup
typeset myLogFile=pe_proxy_master_2160.Wed.log
typeset myFile=aaa.log
typeset -i count=0
count=$(cat pe_proxy_master_2160.Wed.log | wc -c)
echo "COUNT:: $count"
if [ count -gt 32767 ]
then
sed '32768,"$count"d' "$myLogFile" > "$myFile"
fi

COUNT:: 53998

Please advice where i am doing wrong
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

deleting lines in a log file

Is there an easy way to delete the first so many lines in a log file? like I have a log file that has 10000 lines, i want to just get rid of the first 9000. (2 Replies)
Discussion started by: BG_JrAdmin
2 Replies

2. Shell Programming and Scripting

Deleting last 2 lines from the file.

Hi I have a file & always I need to remove or delete last 2 lines from that file. So in a file if I have 10 lines then it should return me first 8 lines. Can someone help me? (4 Replies)
Discussion started by: videsh77
4 Replies

3. Shell Programming and Scripting

Deleting lines in a file

How do I delete all the lines after the line containing text ***DISCLOSURES*** . I want to delete this line too. Thank you (2 Replies)
Discussion started by: reachsamir
2 Replies

4. UNIX for Dummies Questions & Answers

Deleting lines in text file

Hi everyone, I have text files that I want to delete lines from. I have searched through this forum for quite some time and found examples of both awk and sed. Unfortunately, I was not able to successfully do what I want. Well to some extent. I did manage to delete the first 15 lines from each... (5 Replies)
Discussion started by: hern14
5 Replies

5. UNIX for Dummies Questions & Answers

Deleting whole lines from a file

I have a file with 65 sets of 35 coordinates, and would like to isolate these coordinates so that I can easily copy the coordinates to another file. The problem is, I've got a 9 line header before each set of coordinates (so each set is 44 lines long). There are a zillion threads out there about... (3 Replies)
Discussion started by: red baron
3 Replies

6. UNIX for Advanced & Expert Users

Deleting lines from a file

How I can delete 100 lines anywhere in a file without opening a file and without renaming the file. (11 Replies)
Discussion started by: Nirgude07
11 Replies

7. Shell Programming and Scripting

deleting lines from file

We have a server that logs transactions to a file. I want to write a script that will delete the first 50 lines of the file daily without renameing the file or moving the file. (8 Replies)
Discussion started by: daveisme
8 Replies

8. Shell Programming and Scripting

deleting lines in a log file

Hello Community, sorry iam from germany and my englisch is not so well. iam searching for less then 4 hours on the web for a solution of my problem. i have a proxy-log-file and want to delete lines wicht matches on two words. example of the line in the logfile: now i want to delet... (3 Replies)
Discussion started by: matze
3 Replies

9. Shell Programming and Scripting

deleting specific lines in a file

Hello, I have a file like: 26-07-2011 sunz02 message1 26-07-2011 sunz02 message2 26-07-2011 sunz02 message3 15-07-2011 sunz02 message1 15-07-2011 sunz02 message2 15-07-2011 sunz02 message3... (5 Replies)
Discussion started by: asanchez
5 Replies

10. UNIX for Dummies Questions & Answers

Deleting last 3 lines from a file via sed

Hi Anybody can help me to delete the last 3 lines from a text file via sed under SunOS 5.8? Thanks Aldar (4 Replies)
Discussion started by: aldar
4 Replies
GLGETDEBUGMESSAGELOG(3G)					   OpenGL Manual					  GLGETDEBUGMESSAGELOG(3G)

NAME
glGetDebugMessageLog - retrieve messages from the debug message log C SPECIFICATION
GLuint glGetDebugMessageLog(GLuint count, GLsizei bufSize, GLenum *sources, Glenum *types, GLuint *ids, GLenum *severities, GLsizei *lengths, GLchar *messageLog); PARAMETERS
count The number of debug messages to retrieve from the log. bufSize The size of the buffer whose address is given by messageLog. sources The address of an array of variables to receive the sources of the retrieved messages. types The address of an array of variables to receive the types of the retrieved messages. ids The address of an array of unsigned integers to receive the ids of the retrieved messages. severities The address of an array of variables to receive the severites of the retrieved messages. lengths The address of an array of variables to receive the lengths of the received messages. messageLog The address of an array of characters that will receive the messages. DESCRIPTION
glGetDebugMessageLog retrieves messages from the debug message log. A maximum of count messages are retrieved from the log. If sources is not NULL then the source of each message is written into up to count elements of the array. If types is not NULL then the type of each message is written into up to count elements of the array. If id is not NULL then the identifier of each message is written into up to count elements of the array. If severities is not NULL then the severity of each message is written into up to count elements of the array. If lengths is not NULL then the length of each message is written into up to count elements of the array. messageLog specifies the address of a character array into which the debug messages will be written. Each message will be concatenated onto the array starting at the first element of messageLog. bufSize specifies the size of the array messageLog. If a message will not fit into the remaining space in messageLog then the function terminates and returns the number of messages written so far, which may be zero. If glGetDebugMessageLog returns zero then no messages are present in the debug log, or there was not enough space in messageLog to retrieve the first message in the queue. If messageLog is NULL then no messages are written and the value of bufSize is ignored. NOTES
Although debug messages may be enabled in a non-debug context, the quantity and detail of such messages may be substantially inferior to those in a debug context. In particular, a valid implementation of the debug message queue in a non-debug context may produce no messages at all. ERRORS
GL_INVALID_VALUE is generated if count or bufSize is negative. ASSOCIATED GETS
glGet() with argument GL_DEBUG_LOGGED_MESSAGES glGet() with argument GL_DEBUG_NEXT_LOGGED_MESSAGE_LENGTH glGet() with argument GL_MAX_DEBUG_MESSAGE_LENGTH glGet() with argument GL_MAX_DEBUG_LOGGED_MESSAGES SEE ALSO
glDebugMessageInsert(), glDebugMessageCallback(), glDebugMessageControl(). 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 GLGETDEBUGMESSAGELOG(3G)
All times are GMT -4. The time now is 06:15 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy