05-05-2009
Have you tried the tr command?
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hello,
I am attempting to remove all the ^M characters in a file in VI.
The command I am using is
:1,$s/^V^M//g
but it doesn't work, saying 'substitute pattern match failed'.
Any ideas why?
Jules (2 Replies)
Discussion started by: julesinbath
2 Replies
2. UNIX for Dummies Questions & Answers
HI i am having a file this
(sys19:pnlfct:/pfact/temp>) cat temp_sand
1234567890
1234567890
1234567890
1234567890
I want to make this file as
(sys19:pnlfct:/pfact/temp>) cat temp_sand
1456789023
1456789023
1456789023
1456789023
just take the 2nd and 3rd position and put it... (5 Replies)
Discussion started by: arunkumar_mca
5 Replies
3. Shell Programming and Scripting
How can I remove the last character from each line of a file?
This must be done without "funny" characters, as I want to transfer the code to/from Windows.
Any ideas? (17 Replies)
Discussion started by: cjhancock
17 Replies
4. UNIX for Dummies Questions & Answers
Dear Members,
Problem is suppose i have 50 lines in a file, 40 lines last character is "\" and the remaining 10 lines are good(i mean these 10 lines do not have "\" character)
How can i remove this character from the file.
Thanks (1 Reply)
Discussion started by: sandeep_1105
1 Replies
5. UNIX for Dummies Questions & Answers
Hi,
I have a Linux file which has content as sh (0 Replies)
Discussion started by: bhuvanas
0 Replies
6. Shell Programming and Scripting
Hi,
My file has this special character "^M"
I would like to remove this characters.
eg:
abc,abc,^M
i tried using sed but doesnt work.
i used octal dump command to see special character it returns following:
015
\r
Appreciate your reply. (6 Replies)
Discussion started by: pinnacle
6 Replies
7. Shell Programming and Scripting
I have a file like this:
DDD_ABCDE2AB2_1104081408.104480
I need to remove the 1 after the . in the file name so that it reads:
DDD_ABCDE2AB2_1104081408.04480
Having some difficulty getting the command to work. I tried using
cut -d 26
but that just doesn't work. (3 Replies)
Discussion started by: bbbngowc
3 Replies
8. UNIX for Dummies Questions & Answers
I need help removing the last character of every line if it is a certain character. For example I need to get rid of a % character if it is in the last position.
Input:
aaa%
%bbb
ccc
d%dd%
Output should be:
aaa
%bbb
ccc
d%dd
I tried this but it gets rid of all of the % characters.... (5 Replies)
Discussion started by: raptor25
5 Replies
9. Shell Programming and Scripting
Hi below is my file.
cat input.dat
101,abhilash,1000
102,prave
en,2000
103,partha,4
000
10
4,naresh,5000
(its just a example file)
and my output should be:
101,abhilash,1000
102,praveen,2000
103,partha,4000
104,naresh,5000
below is my code
cat input.dat |tr -d '\n' >... (6 Replies)
Discussion started by: abhilash_nakka
6 Replies
10. Shell Programming and Scripting
Hello guys,
I would need to remove the last character ")" of a specific line. This can be from any line. Your help is appreciated. Below is the line.
HOSTNAME=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP))
Please help. (6 Replies)
Discussion started by: sang8g
6 Replies
LEARN ABOUT HPUX
xgetcommand
XGetCommand() XGetCommand()
Name
XGetCommand - get the XA_WM_COMMAND property (command-line arguments).
Synopsis
Status XGetCommand(display, w, argv_return, argc_return)
Display *display;
Window w;
char ***argv_return;
int *argc_return;
Arguments
display Specifies a connection to an X server; returned from XOpenDisplay().
w Specifies the window.
argv_return
Returns the application's argument list.
argc_return
Returns the number of arguments returned.
Returns
Zero on failure, non-zero on success.
Description
XGetCommand() reads the XA_WM_COMMAND property from the specified window and returns a string list. If the XA_WM_COMMAND property exists,
it is of type XA_STRING and format 8. If sufficient memory can be allocated to contain the string list, XGetCommand() fills in the
argv_return and argc_return arguments and returns a non-zero status. If the data returned by the server is in the Latin Portable Character
Encoding, then the returned strings are in the Host Portable Character Encoding. Otherwise, the result is implementation-dependent. Oth-
erwise, it returns a zero status. If the data returned by the server is in the Latin Portable Character Encoding, then the returned
strings are in the Host Portable Character Encoding. Otherwise, the result is implementation-dependent. To free the memory allocated to
the string list, use XFreeStringList().
Errors
BadWindow
See Also
XFetchName(), XGetClassHint(), XGetIconName(), XGetIconSizes(), XGetNormalHints(), XGetSizeHints(), XGetTransientForHint(), XGetWMHints(),
XGetZoomHints(), XSetClassHint(), XSetIconName(), XSetIconSizes(), XSetNormalHints(), XSetSizeHints(), XSetTransientForHint(),
XSetWMHints(), XSetZoomHints(), XStoreName().
Xlib - Window Manager Hints XGetCommand()