Sponsored Content
Top Forums Programming Problem in getting the correct number from the string. Post 302320829 by thanhdat on Friday 29th of May 2009 04:56:35 AM
Old 05-29-2009
This sick command could do the trick
Code:
sed 's/BOOK/\nBOOK/g' youfile.txt | sed 's/BOOK-SEC-\([1-9]\).*/\1/g'

There must be smarter way to do that but i didn't find out yet.

Last edited by thanhdat; 05-29-2009 at 06:22 AM..
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

will reinstalling correct my problem??

about 2 months ago i installed mandrake linux 8.0 however due to my current internet setup (dial up upsteam, and cable downstream) i was never able to get it configured properly so i gave up untill i could change to an all cable isp...well that day is tomorrow!!! what i would like to know is... (1 Reply)
Discussion started by: justchillin
1 Replies

2. Shell Programming and Scripting

sed problem - replacement string should be same length as matching string.

Hi guys, I hope you can help me with my problem. I have a text file that contains lines like this: 78 ANGELO -809.05 79 ANGELO2 -5,000.06 I need to find all occurences of amounts that are negative and replace them with x's 78 ANGELO xxxxxxx 79... (4 Replies)
Discussion started by: amangeles
4 Replies

3. Shell Programming and Scripting

checking invoice number not correct

hello, I have the following script to check the invoice number is in order or not. However, it cannot show out the correct information. My expect output show below and I would like to only list out the NOT IN SEQUENCE inovice number (not included "ok") #!/bin/sh start=1 for file_number in... (8 Replies)
Discussion started by: happyv
8 Replies

4. Solaris

Problem in appending the correct log

Hi All, I have a perl module TrxLog.pm and following are codes in it #!/usr/local/bin/perl package TrxLog; %log_begin=""; %log_end=""; %log_msg=""; %log_start_time=""; %log_end_time=""; $ix=0; @arr_msg=""; if (! -e "TrxLog.txt"){ open (TRX,">TrxLog.txt"); }else{ ... (1 Reply)
Discussion started by: megh
1 Replies

5. Shell Programming and Scripting

string to number problem

Hi actually what happen i have taken a value from database table and stored in variable and that value is 20100601 000000 but this value is stored as string value in database table so after storing this value in variable a when i did operation on this a variable like a=`expr ${a} +1` i m... (1 Reply)
Discussion started by: aishsimplesweet
1 Replies

6. Shell Programming and Scripting

changing number in bash (number is in form of string)

I have a txt file as database. when i run my program what it does is it ask me for 3 name and stored in the file as name1:name2:name3:1 when u enter 3 name it add those in file as above format and add 1 at the end. I what i want is if i enter same names again it changes that 1 to 2 and so... (3 Replies)
Discussion started by: Learnerabc
3 Replies

7. Shell Programming and Scripting

Not showing the correct string...

Scripting GURU, I have written a ksh script to get a number from a file and attempting to input the number into the sendsms output script.. But i am finding that ONCALL_NUMBER is showing as $ONCALL_NUMBER as the output for the TO:$ONCALL_NUMBER@sms.info.com message and not as... (3 Replies)
Discussion started by: Junes
3 Replies

8. UNIX for Beginners Questions & Answers

Concatenate a string and number and compare that with another string in awk script

I have below code inside my awk script if ( $0 ~ /SVC IN:/ ) { svc_in=substr( $0,23 , 3); if (msg_start == 1 && msg_end == 0) { msg_arr=$0; } } else if ( $0 ~ /^SVC OUT:/ ) { svc_out=substr( $0, 9, 3); if (msg_start == 1 && msg_end == 0) ... (6 Replies)
Discussion started by: bhagya123
6 Replies

9. UNIX for Beginners Questions & Answers

Getting correct port number from process id

Hi All, i am trying to find the Jobss port number(either default port number or any other port number assigned) from the running process id. But it's giving me multiple port numbers when searching with netstat command. Can someone help me in finding the correct port number from the... (3 Replies)
Discussion started by: sravani25
3 Replies

10. Programming

Python : Problem with " TypeError: float() argument must be a string or a number "

Hello ! I'm creating a CGI which allow to display graph from some data. The datas looks like : 2020-01-13-00-00,384.00,350.00 2020-01-13-06-00,384.00,350.00 2020-01-13-12-00,384.00,350.00 2020-01-13-18-00,384.00,350.00 2020-01-14-00-00,384.00,350.00... (1 Reply)
Discussion started by: Tim2424
1 Replies
GLGETOBJECTPTRLABEL(3G) 					   OpenGL Manual					   GLGETOBJECTPTRLABEL(3G)

NAME
glGetObjectPtrLabel - retrieve the label of a sync object identified by a pointer C SPECIFICATION
void glGetObjectPtrLabel(void * ptr, GLsizei bifSize, GLsizei * length, char * label); PARAMETERS
ptr The name of the sync object whose label to retrieve. bufSize The length of the buffer whose address is in label. length The address of a variable to receive the length of the object label. label The address of a string that will receive the object label. DESCRIPTION
glGetObjectPtrLabel retrieves the label of the sync object identified by ptr. label is the address of a string that will be used to store the object label. bufSize specifies the number of characters in the array identified by label. length contains the address of a variable which will receive the the number of characters in the object label. If length is NULL, then it is ignored and no data is written. Likewise, if label is NULL, or if bufSize is zero then no data is written to label. ERRORS
GL_INVALID_ENUM is generated if identifier is not one of the accepted object types. GL_INVALID_VALUE is generated if ptr is not the name of an existing sync object. GL_INVALID_VALUE is generated if bufSize is zero. If not NULL, length and label should be addresses to which the client has write access, otherwise undefined behavior, including process termination may occur. ASSOCIATED GETS
glGet() with argument GL_MAX_LABEL_LENGTH. SEE ALSO
glPushDebugGroup(), glPopDebugGroup(), glObjectLabel(), glGetObjectLabel(). 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 GLGETOBJECTPTRLABEL(3G)
All times are GMT -4. The time now is 09:10 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy