![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
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 |
| 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 |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
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
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> 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... |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|