Search Results

Search: Posts Made By: newbie_01
200
Posted By RudiC
Your script seems a bit intricate. E.g. when...
Your script seems a bit intricate. E.g. when using the > redirection, you don't need to create / truncate the file upfront. And, with that many temp files, there must be a better approach. How far...
694
Posted By Don Cragun
Hi newbie_01, Maybe something like this would...
Hi newbie_01,
Maybe something like this would come closer to what you want. The other suggestions don't seem to convert the output to CSV format and don't seem to maintain the fixed-width fields...
694
Posted By itkamaraj
awk '{if(!a[$1 $2 $3 $4...
awk '{if(!a[$1 $2 $3 $4 $5]++){print}else{$1=$2=$3=$4=$5=$6=$7=$8="";print}}' filename
171
Posted By RudiC
Your attempt to sort -t"|" -k1 is not enough, as...
Your attempt to sort -t"|" -k1 is not enough, as (man sort)
, so -k1 is equivalent to no key at all. Try sort -t"|" -k1,1 file
363
Posted By Don Cragun
Hi newbie_01, There is no reason to feel small....
Hi newbie_01,
There is no reason to feel small. We're all here to learn. Next time you'll remember what you need to do.

Unfortunately you didn't tell us what operating system you're using. ...
363
Posted By Don Cragun
You're so close, just off by one character. When...
You're so close, just off by one character. When you use a character other than / as the delimiter in a BRE search pattern, you have to escape the first use of that character with a backslash (i.e.,...
196
Posted By MadeInGermany
The following versions are closer to the original...
The following versions are closer to the original and help to see the directories better:
find . | sed 's#[^/]*/#| #g; s#^\([| ]*|\) #\1--#'
find . | sed 's#[^/]*/#| #g; s#^\([| ]*\)| #\1+--#'
196
Posted By Corona688
Just do find -type f and you'll know that every...
Just do find -type f and you'll know that every top-level name you find is a file and everything beneath must be a folder, i.e. /path/to/filename
282
Posted By apmcd47
No, I think you did the right thing. You searched...
No, I think you did the right thing. You searched the forum for your problem, and now you are asking for a refinement, after finding your own solution, which you consider sub-optimal. I have to admit...
649
Posted By RudiC
There are several errors in your attempt. - the...
There are several errors in your attempt.
- the regex looks for strings with two adjacent _ in them; there is none in the input.
- parentheses lose their special meaning in the replacement and...
649
Posted By Don Cragun
The following seems to do what you want just...
The following seems to do what you want just using standard sed features:
sed 's#\(/db/LTS/abc\)p\(_.*\.dbf\)#\1t\2#' file > file.$$ &&
cp file.$$ file &&
rm file.$$
The \1 and \2 in the...
649
Posted By RudiC
Try sed -r...
Try
sed -r '\#(/db/LTS/abc)p(_.*dbf)$#s//\1t\2/' file


And, yes, the text colour selector (available in the "quick reply editor") seems to be missing in the "advanced editor". But with the bold...
742
Posted By bakunin
The following is probably not the answer you...
The following is probably not the answer you hoped for - i will tell you what you did do wrongly, why it was wrong and how you could do it better. You will still have to implement what i tell you...
717
Posted By RudiC
I'm afraid there's no "quick way" to do what you...
I'm afraid there's no "quick way" to do what you request. It has to be done like what you describe, line by line, value by value. Why don't you post your attempt to be discussed, analysed, and...
1,721
Posted By RudiC
Something along this line? awk -F\* ' ...
Something along this line?
awk -F\* '
{while (length($2) > 0) {T[++C] = substr ($2, 1, 20)
$2 = substr ($2, 21)
}
...
1,721
Posted By RudiC
When double quoting $line, the * chars will be...
When double quoting $line, the * chars will be preserved, and your awk scripts will work. Did you consider reading the variables immediately with bash ?

while IFS="*" read TS CS RS SV RC REST
...
1,721
Posted By vgersh99
-F'*' worked for gawk. What OS are you on? try...
-F'*' worked for gawk. What OS are you on?
try echo "$line"
Why do you need so many awk-s? Cannot you do it with just one?
1,020
Posted By Don Cragun
Hi newbie_01, I'm not as fluent in perl as Aia,...
Hi newbie_01,
I'm not as fluent in perl as Aia, but the following awk script seems to do what you want:
awk '
BEGIN { bpat = "^[[:blank:]]*$"
cpat = "^[cC][rR][eE][aA][tT][eE] "
corpat = cpat...
1,020
Posted By Don Cragun
So, just to be clear, are all of the following...
So, just to be clear, are all of the following true?:

All strings being matched are case insensitive.
If a line contains create starting is column 1, that string should be changed to CREATE or...
1,020
Posted By Aia
Hi, newbie_01, Do you have an objection to a...
Hi, newbie_01,

Do you have an objection to a non-liner?

#!/usr/bin/perl
# search_and_replace.pl
use strict;
use warnings;

my $blank;
my $reuse;
while (<>) {
s/CREATE/CREATE or...
884
Posted By RudiC
How about sort -t^ -k2,2n -k4,4nr file | awk...
How about sort -t^ -k2,2n -k4,4nr file | awk '!T[$2]++' FS=^
- [ qual11 ] - QUAL11^901361709^ARCHIVELOG ^11422138368
- [ test11 ] - TEST11^2609333750^ARCHIVELOG^170184688128
- [ test11 ] -...
2,326
Posted By cjcox
rsync is pretty smart. If all that changes is...
rsync is pretty smart. If all that changes is the meta data (like times), a full copy isn't done if the content is the same. For speed rsync by default looks at time and size to "skip" things it...
1,293
Posted By RudiC
Well, it needs bash 4. date seems to work on the...
Well, it needs bash 4. date seems to work on the second server.
4,269
Posted By Don Cragun
If you save the following script in a file named...
If you save the following script in a file named obfuscate:
#!/bin/ksh
# NAME: obfuscate -- obfuscate text read from one or more files into a
# string that can be decrypted by the dc...
2,376
Posted By Corona688
getopts works inside subroutines. Just be sure...
getopts works inside subroutines. Just be sure to set OPTIND to 1 at the beginning of your functions, since this global value may be left at something strange from your last function.
Showing results 1 to 25 of 55

 
All times are GMT -4. The time now is 07:04 PM.
Unix & Linux Forums Content Copyright 1993-2020. All Rights Reserved.
Privacy Policy