Search Results

Search: Posts Made By: goodbenito
2,007
Posted By goodbenito
This is a good start to something, thank you for...
This is a good start to something, thank you for that!
2,007
Posted By goodbenito
That is a really nice solution, but it applies to...
That is a really nice solution, but it applies to an input text file. In my script, each of those lines is a variable in a loop. I do this so I can place the output of the sed command as a new...
2,007
Posted By goodbenito
Find/replace alpha characters in string
Hi,
I would like to find a 3-letter character series in a string/variable and replace it with x's.

An example set of strings is:

563MS333_101_afp_400-100_screening...
9,217
Posted By goodbenito
remove caret (^) symbol from pattern using sed
Hi,

I am trying to remove the caret symbol from a bash variable. This is the variable:
var="GOTAN^TOK^B"and this is the code I am trying to use to remove the caret symbol:
nocarrot=`echo $var |...
2,128
Posted By goodbenito
Both of them work perfectly. Many thanks to you...
Both of them work perfectly. Many thanks to you both.
2,128
Posted By goodbenito
grep line for string up to symbol
Hi,

I would like to extract a pattern from a line. The first two characters will always be the same in this pattern, but the proceeding numbers will not be, and the pattern will always be 6...
1,235
Posted By goodbenito
You're the best. Thanks!
You're the best. Thanks!
1,235
Posted By goodbenito
This works great, but I actually realize my...
This works great, but I actually realize my mistake in writing that I wished to retain everything but the line with the second occurrence of the pattern. I would like to retain everything in the text...
1,235
Posted By goodbenito
retaining only the second line with a pattern and deleting all others
Hi,

I have a file:

5 T1AxialPremosaic ok 512 448 23 1 284000-000005-000001.dcm
6 T2_SPACE ok 256 256 176 1 465000-000006-000001.dcm
7 FLAIRmosaic ok 512 432 23 1 748000-000007-000001.dcm
8...
8,489
Posted By goodbenito
awk conditional expression to compare field number and variable value
Hi,

I'm trying to compare the value in a field to the value in a variable using awk. This works:

awk '$7 == "101"'but this is what I want (and it doesn't work):


value=101
awk '$7 ==...
3,713
Posted By goodbenito
Thanks Guru. It prevented the output of any error...
Thanks Guru. It prevented the output of any error messages, but the variable was empty unfortunately. I'll keep working on this, thanks anyway!
3,713
Posted By goodbenito
set variable using 'ls' with an 'or' conditional statement
Hi,

I would like to set a variable using ls, but I need to be able to list two possibilities simultaneously, i.e., I'd like to do this all on one line. These are the two possible directories, but...
30,297
Posted By goodbenito
If I try sheelscripter's suggestion: ...
If I try sheelscripter's suggestion:



$sername=field_mapping

if [ $sername == *map* ] || [ $sername == *DTI*FA* ]; then echo "Found an FA tag in sername"; else echo "The variable sername is...
30,297
Posted By goodbenito
cannot properly employ "or" operator in an if statement (bash)
Hi,

I have a variable, $sername, and I would like to display this variable only if it *does not* contain either of these two tags: *DTI*FA* or *DIFF*FA*.

I think the syntax for my 'or'...
5,872
Posted By goodbenito
That was a perfect solution. Thanks!
That was a perfect solution. Thanks!
5,872
Posted By goodbenito
Assigning a specific format to a specific column in a text file using awk and printf
Hi,

I have the following text file:

8 T1mapping_flip02 ok 128 108 30 1 665000-000008-000001.dcm
9 T1mapping_flip05 ok 128 108 30 1 665000-000009-000001.dcm
10 ...
14,738
Posted By goodbenito
Jim - once again, your code worked flawlessly....
Jim - once again, your code worked flawlessly. Thanks to all for the other solutions, too!
14,738
Posted By goodbenito
replace all numbers in column with another number in bash
Hi,

I've been trying to replace the numbers in the first column of my text file with all ones, unless the number is equal to 8. I have this:

1 1 11 123 258
2 1 9 135 175
1 1 15 143 274...
6,125
Posted By goodbenito
That worked perfectly, thank you! There are...
That worked perfectly, thank you! There are ABC_1* dirs, but I just moved the asterisk, it was fine:

find /mypath/ABC_* -type d -name 'VISIT*'

Thanks again.
6,125
Posted By goodbenito
cat a list of directory paths only to a file
Hi!
I would like to funnel a series of directories and subdirectories into a text file. This is the output I would like to see from a find command:

/mypath/ABC_01/VISIT_01...
Showing results 1 to 20 of 20

 
All times are GMT -4. The time now is 05:11 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy