I want to replace a character in a line, but position will be different form one iteration to another.
So i m keeping the position i a variable.
I am trying with following code
But its not working, Can you please help.
Thanks
Last edited by Yogesh Sawant; 04-02-2009 at 02:41 AM..
Reason: added code tags
Hi ,
I need to change the last character of the line:
ie:
input file:
(raj,
muthu,
mani,
Output:
(raj,
muthu,
mani);
so i need to change the last comma by the closing braces so help me out in the issue.
Thanks in advance. (2 Replies)
hi
i have a file and reading line by line, i need to replace 8-15 and 18-27 charaters with character 'x'.
Eg: satyasatxxxxxxxsatxxxxxxxxxtyasatyasatyasatyasatyasatya
please help
thanks
Satya (1 Reply)
Hi All,
I would like to know how, iff at all we can, we may use the 'tr' command to replace a single character with multiple characters.
eg: if i have a string valued "him", how can i use 'tr' to replace 'i' with "oo" to make "hoom".
Just replacing a single character by many.
tried:-... (16 Replies)
Hi All,
contents of my file is like this:
xxx xxx1 N N N 0
yyy yyy1 Y N N 0
i want to replace 1st N of xxx xxx1 N N N 0 line with Y.
i. e i want the output like this:
xxx xxx1 Y N N 0
how can i do this?
please help.
Thanks (8 Replies)
hi,
when i am doing the following things getting error
Can anyone please suggest
i have a file where there is a line like the following
branch=dev sdf dev jin kilii fin kale boyle dev james dev
i want to search the existance of dev in the above line.
cat "$file" | sed -n... (8 Replies)
Hi Experts,
I have data coming in 4 columns and there are new line characters \n in between the data. I need to remove the new line characters in the middle of the row and keep the \n character at the end of the line.
File is comma (,) seperated.
Eg:
ID,Client ,SNo,Rank
37,Airtel \n... (8 Replies)
I have a file (pema)with a single long record which i have to break up into multiple lines
Input
s1aaaaaaaaaaaaaaaaaaaaaaas1bbbbbbbbbbs1cccccccccc
Output
s1aaaaaaaaaaaaaaaaaaaaaaa
s1bbbbbbbbbb
s1cccccccccc
m planning to do it by replacing s1 by \ns1 \n is the new line character
i... (5 Replies)
Hi, I need to replace a character between two numbers (specifically a - to a _). The problem is that they can be *any* numbers. So, I need a one liner to turn a file like this:
1-2
3-4
55-66
4323-12312893
into the following
1_2
3_4
55_66
4323_12312893
Any help would be appreciated! (5 Replies)
Hello is it possible with awk or sed to replace any white space with the previous line characters in the same position?
I am asking this because the file I have doesn't always follow a pattern.
For example the file I have is the result of a command to obtain windows ACLs:
icacls C:\ /t... (5 Replies)
Discussion started by: nakaedu
5 Replies
LEARN ABOUT DEBIAN
mouse_pos
mouse_x(3alleg4) Allegro manual mouse_x(3alleg4)NAME
mouse_x, mouse_y, mouse_z, mouse_w, mouse_b, mouse_pos - Global variable with the mouse position/button state. Allegro game programming
library.
SYNOPSIS
#include <allegro.h>
extern volatile int mouse_x;
extern volatile int mouse_y;
extern volatile int mouse_z;
extern volatile int mouse_w;
extern volatile int mouse_b;
extern volatile int mouse_pos;
DESCRIPTION
Global variables containing the current mouse position and button state. Wherever possible these values will be updated asynchronously,
but if mouse_needs_poll() returns TRUE, you must manually call poll_mouse() to update them with the current input state. The `mouse_x' and
`mouse_y' positions are integers ranging from zero to the bottom right corner of the screen. The `mouse_z' and `mouse_w' variables hold the
current vertical and horizontal wheel position, when using an input driver that supports wheel mice. The `mouse_b' variable is a bitfield
indicating the state of each button: bit 0 is the left button, bit 1 the right, and bit 2 the middle button. Additional non standard mouse
buttons might be available as higher bits in this variable. Usage example:
if (mouse_b & 1)
printf("Left button is pressed
");
if (!(mouse_b & 2))
printf("Right button is not pressed
");
The `mouse_pos' variable has the current X coordinate in the upper 16 bits and the Y in the lower 16 bits. This may be useful in tight
polling loops where a mouse interrupt could occur between your reading of the two separate variables, since you can copy this value into a
local variable with a single instruction and then split it up at your leisure. Example:
int pos, x, y;
pos = mouse_pos;
x = pos >> 16;
y = pos & 0x0000ffff;
SEE ALSO install_mouse(3alleg4), poll_mouse(3alleg4), mouse_needs_poll(3alleg4), exalpha(3alleg4), exlights(3alleg4), exmouse(3alleg4),
exshade(3alleg4), exspline(3alleg4), extrans(3alleg4)Allegro version 4.4.2 mouse_x(3alleg4)