The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



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
Extracting data from text file based on configuration set in config file suparnbector Shell Programming and Scripting 3 08-10-2007 03:25 AM
How to copy data into a single file plus title c0384 Shell Programming and Scripting 4 05-15-2007 10:15 AM
copy diff files Hitori UNIX for Advanced & Expert Users 3 07-15-2006 07:53 AM
getting data from config file esham Shell Programming and Scripting 7 11-21-2005 12:24 AM
How to copy data file from UNIX and put it on PC BillyT UNIX for Dummies Questions & Answers 3 01-22-2001 10:09 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 01-29-2008
single single is offline
Registered User
  
 

Join Date: Oct 2007
Posts: 7
Cool Copy data and send it to other file, with diff config

I need a new script to 'grep' data from files in var
and send it to another file in var folder with diff output,
but like you now my Now How is very, very small then to have a idea is something like this:


in file text1.txt have a few lines like this one:
Code:
Y: { XXX1 { XXX2 YYYY { IIIIIIII { AA BB }}}}

Variavel:
XXX1
XXX2
YYYY
IIIIIIII
AA
BB
and I whant to send it to file text2.txt
with this output:

G: 88888888 LLLLLLL 55555 IIIIIIII XXX1 YYYY

where 88888888 LLLLLLL 55555, is in all the lines the same and i need to add Y lines but
only the variavel's IIIIIIII XXX1 YYYY in G lines.




File text1.txt is in folder /var/ and text2.txt is in folder /var/ to.

I need also to read conf file with data and send it to diferent files, like:

my.conf
Code:
Data:
==============
SERVER_PORT=20000 send it to ports.cfg in var like this:
SERVER PORT : 20000
USER=root send it to ports.cfg in var like this:
USERNAME : root
PASS=pass send it to ports.cfg in var like this:
PASS : pass
Port=16000 send it to portsall.cfg in var like this:
Port          = 16000
==============
Device= XXXXXX 
PortDevice1=16000 send it to portsall.cfg in var like this: 
Device           = XXXXX,16000
==============
UDP_HOST=192.168.1.110
TCP_HOST=192.168.1.110
UDP_PORT=1000
TCP_PORT=3001  send it to config.xml in var like this:

<udp_host>192.168.1.110</udp_host>
<tcp_host>192.168.1.110</tcp_host>
<udp_port>1000</udp_port>
<tcp_port>3001</tcp_port>
In text1.txt I have Z line too and i need to add to conf to
Code:
zebrareport=0110
zebraip=10.0.0.2
zebraudpport=8024 and send it to text1.txt in var like this:

Z: { 01 10 } 10.0.0.2 8024

Well if you help me with this i will very happy, Thank's.

Note: Froget in files there is coments "#", this is not to display or show, then ignore coments.
Sorry for my english...
I think i explained well but any question i will try to explained better...
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 12:20 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0