To keep the forums high quality for all users, please take the time to format your posts correctly.
First of all, use Code Tags when you post any code or data samples so others can easily read your code. You can easily do this by highlighting your code and then clicking on the # in the editing menu. (You can also type code tags [code] and [/code] by hand.)
Second, avoid adding color or different fonts and font size to your posts. Selective use of color to highlight a single word or phrase can be useful at times, but using color, in general, makes the forums harder to read, especially bright colors like red.
Third, be careful when you cut-and-paste, edit any odd characters and make sure all links are working property.
Thank You.
The UNIX and Linux Forums
---------- Post updated at 01:11 PM ---------- Previous update was at 01:09 PM ----------
I have some strings such as
ABC1
ABC2
TYFASDD12
They will only have letters and numbers. In each case I want to remove the last digit? The lengths will vary. So a hard coded substr won't work. What do I do?
if it doesn't end in a number, I don't want to remove any characters. (6 Replies)
Hi I have a simple request but can't find the answer. I want to remove trailing zeros, and in some cases the fullstops, from the input data. Example of input file:
FR002_15.000_20.000
SD475_5.000_10.500
FG5647_12.250_15.500
BH2463_30.555_32.000
Desired output file would be:
... (10 Replies)
I have:
2012/01_January/Kite/foldername/otherfoldername/placeholderBlue
I want to end up with:
/foldername/otherfoldername/2012/01_January/Kite/Blue
Basically take everything before the first tab and put it in the place of the consistently named word placeholder and add a slash in place... (2 Replies)
I'm trying to replace an alias with its match using sed but the match contains forward slashs so it causes the sed command to throw a garbled message..
cmd_list.txt sample
AIX_myserver_1011_vintella.sudoers_cmndalias sample
I'm trying to use the below but like I say it throws a... (5 Replies)
I would prefer to use Sed, but I will do whatever necessary. I want to know a good way to remove ":" and "/" from the first string surrounded in Double quotes, but not the 2nd.
Current File:
"9781238274584-Ace of Spades: The Poop" "Ace of Spades: The Poop" ...Desired:
"9781238274584-Ace of... (6 Replies)
I'm using this thread as an example, but can't seem to apply it to my situation.
I'm trying to strip the trailing slash (/) from an input argument. Here's a snippet of my command line input and the troublesome code:
$ script_name -s "../pathname/dir/"
snip 8< ...
while getopts :s:... (5 Replies)
Hello, I am trying to write a script that will calculate the amount of data remaining in a storage volume. I'm running Tru64 Unix version 5.1B patch kit 6. The script is being run against an AdvFS domain. I am programming in Korn Shell version M-11/16/88f.
The basic idea is that I want to run df... (3 Replies)
Hi,
I have a file like this
(ADD_MONTHS((Substr(Trim(BOTH FROM Translate(Maximum(closeDa
------------------------------------------------------------
2007-06-30 00:00:00
I have a requirement where i need just the date.
When i do: tail -1... (2 Replies)
hi all,
im trying to use a sed command to remove all occurenes of \p\g
what i used so far is : sed 's!\p\g!!g' file
but this doesnt work ?
Any ideas, thanks for helping. (2 Replies)