Search Results

Search: Posts Made By: mystition
1,238
Posted By nezabudka
awk -F, 'NR==FNR {T[$1]=$2;B[$1]=$2; next} ($1 in...
awk -F, 'NR==FNR {T[$1]=$2;B[$1]=$2; next} ($1 in T) { $0 = $0 FS $1 FS T[$1] ;delete B[$1]} END { for(i in B) print i FS B[i] } 1' file1 file2
And I also made a mistake in the name of the array at...
1,238
Posted By RudiC
Similar but slightly simplified approach: awk...
Similar but slightly simplified approach:
awk -F, '
NR==FNR {T[$1] = $0
next
}
($1 in T) {$0 = $0 FS T[$1]
B[$1]
...
1,238
Posted By RudiC
DON'T manipulate scripts without EXACTLY knowing...
DON'T manipulate scripts without EXACTLY knowing what you are doing, here: condensing a multi line script into a one liner. By sheer accident, your unfortunate manipulation still works for me:

...
2,155
Posted By RudiC
You have to close the file or pipe with EXACTLY...
You have to close the file or pipe with EXACTLY the name/string you opened it, identical char by char. Closing "epochtime" or "starttime" you missed the "date -r" partial string.
2,155
Posted By RudiC
What's your OS and date version? The -r has...
What's your OS and date version? The -r has different meanings across systems.
Howsoever, try this modification of your code:
awk -F, 'BEGIN {OFS = FS} {cmd = "date -r" $3*65536+$5; cmd | getline...
2,114
Posted By RudiC
awk works in pattern {action} pairs. If pattern...
awk works in pattern {action} pairs. If pattern evaluates to TRUE, the respective action is executed. 1 is always TRUE, and for a missing actions the default, print, will be taken.
14,109
Posted By rangarasan
Couple of things, You don't need to use cat to...
Couple of things, You don't need to use cat to pass the file content to awk. It's useless use of cat.

You can specify the single quote to get the shell variable interpolate.


awk -F,...
2,114
Posted By bakunin
Standard disclaimer: to "understand" XML a...
Standard disclaimer: to "understand" XML a program(ming language) needs to work context-sensitive. For this you need a (recursive) parser Because regexp machines (like sed or awk) aren't...
2,114
Posted By MadeInGermany
Also doable with sed, continuing on your attempt ...
Also doable with sed, continuing on your attempt
sed -e '/<OfferDefinition Id="/ {h; s/.*=" *//; s/ *">.*//; x; n;}' -e '/<Description>/ {H; x; s/\(.*\)\n\(.*<Description>\)/\2\1_/;}' file.txtBetter...
2,114
Posted By rdrtx1
this adds Id value in the Description tag: awk...
this adds Id value in the Description tag:
awk '
/<\/OfferDefinition>/ {id=""}
/<OfferDefinition Id=/ {id=$0; sub(".*Id=\"", "", id); sub("\".*", "", id);}
/<Description>.*<\/Description>/ &&...
2,114
Posted By RudiC
Try also awk -F\" '/OfferDefinition>/ {ID = $2}...
Try also
awk -F\" '/OfferDefinition>/ {ID = $2} /Description>/ {sub (/>/, "&" ID "_")} 1' file
1,184
Posted By MadeInGermany
Another sed solution with the loop technique,...
Another sed solution with the loop technique, written as a multi-liner
sed -n '
\#<OfferDefinition Id# {
:Loop
N
\#</OfferDefinition># !b Loop
...
1,184
Posted By RudiC
How about extending your approach a little? sed...
How about extending your approach a little?
sed -n '/<OfferDefinition Id/,/OfferDefinition>/ H;/OfferDefinition>/ {g;/<Type>Timer.*<EnableAtProvisioning/p;s/.*//;x;}' file
4,575
Posted By RudiC
How about awk -F"," ' FNR==NR {A[$1] =...
How about awk -F"," '
FNR==NR {A[$1] = $0
B[$1] = $2
next
}
!($1 in A) {print $0 > "COND1"
next
...
6,475
Posted By RudiC
awk -F, ' T = (T =...
awk -F, '
T = (T = $1%100)<16?1:T<26?2:T<41?3:"" {print "General", $1, 123, 0, $3, 0 > ("FILE" T ".txt")}
' OFS="," file
5,724
Posted By RavinderSingh13
Hello mystition, Following may help you in...
Hello mystition,

Following may help you in same, let me know if you have any queries.

awk 'NR==FNR ####### This condition will be TRUE when first file named file is being read, because...
5,724
Posted By RavinderSingh13
Hello mystition, Could you please try...
Hello mystition,

Could you please try following and let me know if this helps.

awk 'FNR==NR{A[$1]=$1;next} ($1 in A){print $0 FS A[$1]} !($1 in A){print $0}' file1 FS=, file2
Output will be...
Forum: Solaris 04-21-2013
1,735
Posted By DukeNuke2
you need a xxd which is a hexdump of data... this...
you need a xxd which is a hexdump of data... this can be done with the od -x in solaris.
and a sha256 checksum can be created with digest -a sha256 command.
Forum: Solaris 09-20-2012
2,670
Posted By jlliagre
Here is how I would do it (although untested): ...
Here is how I would do it (although untested):
prtvtoc /dev/rdsk/c0t5000C50047C6CBD5d0s2 | fmthard -s - /dev/rdsk/c0t5000CCA02533FC85d0s2
installgrub /boot/grub/stage1 /boot/grub/stage2...
Forum: Hardware 04-06-2012
3,675
Posted By hicksd8
As DukeNuke2 says, the serial cable needs to be...
As DukeNuke2 says, the serial cable needs to be the right one. Also, you could just try HyperTerminal setting flow control to "none".

Try entering ctrl-Q in case the Sun port is x-off'd.

If...
Forum: Hardware 04-06-2012
3,675
Posted By DukeNuke2
maybe the wrong adaptor... this works for me: ...
maybe the wrong adaptor... this works for me:
What is a Cisco console cable? - David?s Cisco Networking Blog (http://itknowledgeexchange.techtarget.com/cisco/what-is-a-cisco-console-cable/)
2,756
Posted By ciupinet
Use the following: first check for the existence...
Use the following: first check for the existence of the key in the known_hosts file and if it is there then run ssh with publickey as the only authentication option:
if grep "$host"...
Showing results 1 to 22 of 22

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