![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| compare XML/flat file with UNIX file system structure | shafi2all | High Level Programming | 6 | 08-15-2008 03:15 AM |
| Awk to convert a flat file to CSV file | rkumudha | Shell Programming and Scripting | 14 | 07-17-2008 10:48 PM |
| match string in a file to file in a directory | Jae | Shell Programming and Scripting | 5 | 01-19-2008 01:11 AM |
| Remove 5th character from Field1 & Print | Raynon | Shell Programming and Scripting | 9 | 12-14-2007 05:57 AM |
| Converting Pivot file to flat file | vskr72 | Shell Programming and Scripting | 2 | 10-18-2005 05:41 PM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
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 what i need (explained way) CSV file: field1 | field2 "hello","byebye" "hello2","byebye2" "hello3","byebye3" Flat file has matching data: "hello" "hello2" "hello3" If found: "hello" "hello2" "hello3" ..in flat file, then it must be replaced from csv file with FIELD2 according to search match. But i have to search "hello" from csv file field1 data with flat file together and if found match in flat file, it must be replaced from csv file with field2 data. I know i could split csv file to two files, one containing field1 data and second file field2 data but that would be not so dynamic way. Though then i could easily use loop with cat + sed Idea is to make nagios mass updating hosts naming changes in config. So im wondering could i do it with awk or sed more universal way? Any examples would be great help. Thanks in advance.. Frankie Last edited by frankie_konin; 02-01-2009 at 06:21 PM.. |
| Bookmarks |
| Tags |
| host_name, nagios, update |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|