Search Results

Search: Posts Made By: frankie_konin
13,060
Posted By frankie_konin
yep, seems to be that way. seems to work fine...
yep, seems to be that way.
seems to work fine now.

BIG, BIG thank you for helping me out.
I will get VIP account just to help this community my way also.

:b:

cheers and best regards,...
13,060
Posted By frankie_konin
cat nagios.cfg.txt define host{ ...
cat nagios.cfg.txt


define host{
use generic-host
host_name hello
alias other.hello2
address...
13,060
Posted By frankie_konin
Yep, if changing to "other" then works :) ...
Yep, if changing to "other" then works :)

cat nagios.cfg.txt

define host{
use generic-host
host_name other
alias ...
13,060
Posted By frankie_konin
cat -vet nagios.cfg.txt define host{$ ...
cat -vet nagios.cfg.txt


define host{$
use generic-host$
host_name hello$
alias hello.hello$
...
13,060
Posted By frankie_konin
Very weird. Checked, proof: cat fran4.awk ...
Very weird. Checked, proof:

cat fran4.awk

BEGIN {
FScsv=","
FScfg=FS

if (sep=="") sep="."

qq=sprintf("%c", 034)
}
FNR==NR && FNR==1 {FS=FScsv;$1=$1}
FNR!=NR && FNR==1...
13,060
Posted By frankie_konin
Almost works: nawk -v sep=',' -f fran4.awk...
Almost works:

nawk -v sep=',' -f fran4.awk test.csv.txt services.txt


define service{
use generic-service
service_description TCP_80
host_name hello,byebye2,byebye3,nochangematch
...
13,060
Posted By frankie_konin
Odd, now changes nothing nawk -v sep='.' -f...
Odd, now changes nothing

nawk -v sep='.' -f fran3.awk test.csv.txt nagios.cfg.txt


define host{
use generic-host
host_name hello
alias hello.hello
address 127.0.0.1
contact_groups mymail...
13,060
Posted By frankie_konin
This way: cat test.csv "hello","byebye"...
This way:

cat test.csv

"hello","byebye"
"other","data"
"hello2","byebye2"
"hello3","byebye3"
"other","data"
cat nagios.cfg

define host{
use ...
13,060
Posted By frankie_konin
Hmm then im stuck with new problem. In my case...
Hmm then im stuck with new problem. In my case host_name didn't change but it had match in test.csv Did you made some changes in your code?

In alias field.. I am kinda bad with all english words.....
13,060
Posted By frankie_konin
Seems we are getting there: did run your...
Seems we are getting there:

did run your code.
output:

nawk -f fran.awk test.csv nagios.cfg
define host{
use generic-host
host_name ...
13,060
Posted By frankie_konin
Hello, thanks for reply but this only prints csv...
Hello, thanks for reply but this only prints csv field2 data.

I need to search from csv file first field1 and same time from
flat file and if both csv and flat file have a match, then replace...
13,060
Posted By frankie_konin
csv file to array, match field1, replace in flat file field1 to field2
Hello, i am bit stuck with making script for automatic procedure.

Case:

Two files. One is flat file, other is csv file.
csv file has two column/fields with comma delimited data.

Here is...
Showing results 1 to 12 of 12

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