12-02-2008
thanks a lot, but we can not use $4 as field separator is not single space all the times..can we send any index(position) as an argument to sub function....
10 More Discussions You Might Find Interesting
1. UNIX for Advanced & Expert Users
Hi,
This is the format of the file that i have
StartDate:10/01/06
EndDate :10/02/06
Cno Ccode
1 10
2 11
StartDate:10/03/06
EndDate :10/04/06
Cno Ccode
2 13
4 12
StartDate:10/01/06
EndDate :10/02/06 (5 Replies)
Discussion started by: kkm_job
5 Replies
2. UNIX for Dummies Questions & Answers
Hi ,
supoose i have a file in which a word is repeated so many times.
I just want the firts occurence of that word through grep and it should not go to the next one means get the first occurence and stop there.
Suggest me some solutions.
Thanks
Namish (10 Replies)
Discussion started by: namishtiwari
10 Replies
3. Shell Programming and Scripting
I try to run this script, however, it gives an exception in line 3. How do I do an assignment to a substituted variable?
#!/bin/bash
name=fruit
ext_$(eval echo ${name})=apple
tmp=ext_$(eval echo ${name})
if ]; then
echo "apple"
elif ]; then
echo "orange"
fi
echo ${!tmp}
Error... (2 Replies)
Discussion started by: angelokh
2 Replies
4. Programming
Is there any way to produce a code with all use dmacro to be substituted up to 'ready for compilation' condition?
Some macro are build up and it is hard to replace all them up to final code by hand.
I need to see the final line after all macro been applied by preprocessor.
How that could be... (5 Replies)
Discussion started by: alex_5161
5 Replies
5. Shell Programming and Scripting
I'm not getting the syntax correct to change a line only on the first occurrence:
I've tried to change only the first match and I've tried to change the from the second match forward
sed 's/<B>PT#/<tr><td class=\"pt1\" width=\"40%\"><B>pt#/1' $file > tmpfile.html
sed ... (0 Replies)
Discussion started by: dba_frog
0 Replies
6. UNIX for Dummies Questions & Answers
Hi there,
how can i print the first pattern occurrence in a .log file?
I want to print the filename of the first 17262?
I tried but all I can do is print all the lines with the number 17262?
I tried using awk and sed but nothing!:wall:
I just want filename!
Here´s an example:
17259... (3 Replies)
Discussion started by: BMatter
3 Replies
7. Shell Programming and Scripting
Dear all,
I have data like below and i need to add coloumn before the COUNT field to see the Percentage out of all COUNT field value for respective raw.
=============================================
COUNT CODE sConnType tConnType... (6 Replies)
Discussion started by: Iroshan
6 Replies
8. Shell Programming and Scripting
I have a file
# cat asasas
AAAAAA
11
22
33
44
BBBBB
NILNILNIL
AAAAAA
22
33
44
55
66
77
88
BBBBB
NILNILNIL (2 Replies)
Discussion started by: anil510
2 Replies
9. UNIX for Advanced & Expert Users
I have an output file which gives me the timely status of a server.
Sample file:
March 11 2014
21:10, 1, 2, 3, 4, 5, 6, 7, 8, 9, x, y, z...
21:05, 1, 2, 3, 4, 5, 6, 7, 8, 9, x, y, z...
21:00, 1, 2, 3, 4,... (3 Replies)
Discussion started by: rpm120
3 Replies
10. Shell Programming and Scripting
Hi all,
I started playing around with Python (2.6.6) trying to parse a file. No matter what I tried so far I am not able to print only the lines/group/backreference that have been affected by the substitution. Instead I get also the other lines too
File to parse:
some more text
... (2 Replies)
Discussion started by: zaxxon
2 Replies
LEARN ABOUT CENTOS
d_list_proc
d_list_proc(3alleg4) Allegro manual d_list_proc(3alleg4)
NAME
d_list_proc - Dialog procedure implementing a list box object. Allegro game programming library.
SYNOPSIS
#include <allegro.h>
int d_list_proc(int msg, DIALOG *d, int c);
DESCRIPTION
A list box object. This will allow the user to scroll through a list of items and to select one by clicking or with the arrow keys. If the
D_EXIT flag is set, double clicking on a list item will close the dialog. The index of the selected item is held in the d1 field, and d2 is
used to store how far it has scrolled through the list. The dp field points to a function which will be called to obtain information about
the contents of the list. This should follow the form:
char *foobar(int index, int *list_size);
If index is zero or positive, the function should return a pointer to the string which is to be displayed at position index in the list. If
index is negative, it should return NULL and list_size should be set to the number of items in the list.
To create a multiple selection listbox, set the dp2 field to an array of byte flags indicating the selection state of each list item (non-
zero for selected entries). This table must be at least as big as the number of objects in the list!
SEE ALSO
exgui(3alleg4)
Allegro version 4.4.2 d_list_proc(3alleg4)