10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi all,
I need to remove DBPATH= and /db from the string below using awk (or sed, as it also exists on the machine).
Input: DBPATH=/some/path/database/db
Desired output: /some/path/database
Thank you! (8 Replies)
Discussion started by: ejianu
8 Replies
2. UNIX for Dummies Questions & Answers
Here is my task, I feel sure this can be accomplished with see/awk but can't seem to figure out how.
I have large flat file from which I need to extract every case of a pairing of characters (GG) in this case PLUS the previous 20 characters. The output should be a list (which I plan to make... (17 Replies)
Discussion started by: Twinklefingers
17 Replies
3. Shell Programming and Scripting
I have a variable containing a list of strings, and want to create a string with the first character being -.
Example:
var="-name fred paul -surname winnett dimech"
I want a string, namely
errStr="-name -surname" (2 Replies)
Discussion started by: kristinu
2 Replies
4. Shell Programming and Scripting
Hello,
I want to writte a script that replace two character strings by two variables with the command sed butmy solution doesn't work. I'm written this: sed "s/TTFactivevent/$TTFav/g && s/switchSLL/$SLL/g" templatefile.
I want to replace TTFactivevent by the variable $TTFav, that is a... (4 Replies)
Discussion started by: POPO10
4 Replies
5. Shell Programming and Scripting
Another frustrating scripting problem from a biologist trying to manipulate a file with several millions line. For each of the line I need to compare the uppercase A or C or G or T with the lowercase a or c or g or t. If there are more uppercases, a + should be added to a new column, otherwise a -... (10 Replies)
Discussion started by: ivpz
10 Replies
6. UNIX for Dummies Questions & Answers
OK This one has me stumped. I have the following line,
program name - the program description that can also contain a hyphen - character.
I'm need to separate the "program name" from the program description.
I've tried using an array function with the - as delimiter, but I ran into a... (2 Replies)
Discussion started by: ricksj
2 Replies
7. UNIX for Dummies Questions & Answers
Hello Can Any1 help me.
I want to replace a specific character string inside a file at a specific location with a particular character with the help of a command or a shell script.
The tr command replaces a specific character with another for all the occurences of that character in the file.
I... (5 Replies)
Discussion started by: rahulrathod
5 Replies
8. Shell Programming and Scripting
Hello,
I would like to find an efficient way to compare a pair of strings that differ at one position, and return the difference and position.
For example:
String1 123456789
String2 123454789
returning something - position 6, 6/4
Thanks in advance,
Mike (5 Replies)
Discussion started by: etherite
5 Replies
9. Shell Programming and Scripting
I use SAS (a statistical software) and have to remove last character or the last 1/2 numbers that appear after characters from the string using Perl Regular Expression (which is recognized by SAS).
Input: f183ii10 f183ii2 f182ii1 f182ii2 f183iim f22ii f22ii11 f22ii12 pmh4 pmhm
Desired... (2 Replies)
Discussion started by: ospreyeagle
2 Replies
10. UNIX for Dummies Questions & Answers
I have three lines in a log that I want to check to make sure that they say the following (mm/dd/yyyy and hh:mm:ss changes depending in when the log is generated):
'*** Testing file for mm/dd/yyyy'
'*** End of procedure! Time was: hh:mm:ss'
'*** End ***'
I did some sed... (13 Replies)
Discussion started by: giannicello
13 Replies