Sponsored Content
Top Forums Shell Programming and Scripting awk or sed or any commands to stripe data Post 302874087 by timmywong on Thursday 14th of November 2013 05:31:02 AM
Old 11-14-2013
awk or sed or any commands to stripe data

Say i have:
Code:
g_gateway domain="abc.com" to="123.123.123.123" relay="false"

how do i use awk or sed or any method to get the result below:
Code:
abc.com 123.123.123.123


Last edited by Franklin52; 11-14-2013 at 06:44 AM.. Reason: Please use code tags for code and data samples
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Using variables within awk/sed commands

Can I use my own variables within awk and sed for example: I've written a while loop with a counter $i and I want to use the value of $i within sed and awk to edit certain lines of text within a data file. I want to use : sed '1s/$/texthere/g' data.csv Like this: sed '$is/$/$age/g' data.csv... (5 Replies)
Discussion started by: mustaine85
5 Replies

2. Shell Programming and Scripting

formatting data file with awk or sed

Hi, I have a (quite large) data file which looks like: _____________ header part.. more header part.. x1 x2 x3 x4 x5 x6 x7 x8 x9 x10 x11 x12 x13 ... ... x59 x60 y1 y2 y3 y4... ... y100 ______________ where x1, x2,...,x60 and y1, y2,...y100 are numbers of 10 digits (so each line... (5 Replies)
Discussion started by: lego
5 Replies

3. Linux

Adding a prefix to a column using awk/sed commands

Hello, I am a newbie to linux and struggling to find a better way to append a column in a text file. Here is the file i want to modify: It has 8 columns (and thousands of rows). I want to append the first column by adding "chr" infront of the numbers. Some rows have a string in the first... (4 Replies)
Discussion started by: bjorngill
4 Replies

4. Shell Programming and Scripting

Using sed or awk to turn data into html

Hi there, I'm wondering the best way to go about this. I have a file which is fairly specific in its format, but it has some options in it that mess up what I need. I'll give you an example of a couple of lines: Bob D Thomas D/F Alice A/F Michael A/D/F John Michael B Bachman Turner A/D... (7 Replies)
Discussion started by: melancthon
7 Replies

5. Shell Programming and Scripting

Have to learn sed and awk commands in kSH?

Links Please??? (2 Replies)
Discussion started by: Diddy
2 Replies

6. Shell Programming and Scripting

Passing parameter in sed or awk commands to print for the specific line in a file

Hi, I am trying to print a specific line in a file through sed or awk. The line number will be passed as a parameter from the previous step. My code looks as below. TEMP3=`sed -n '$TEMP2p' $FILEPATH/Log.txt` $TEMP2, I am getting from the previous step which is a numerical value(eg:3). ... (2 Replies)
Discussion started by: satyasrin82
2 Replies

7. Shell Programming and Scripting

Variables into SED or AWK and multiple commands

Hello I am hoping you may help. I am not sure how to go about this exactly, I know the tools but not sure how to make them work together. I have two SED commands that I would like to run in a shell script. I would like to take the manual input of a user (types in when prompted) to be used... (4 Replies)
Discussion started by: lostincashe
4 Replies

8. Shell Programming and Scripting

Merging data from col 3 to col2 with awk or sed

Dear Friends, I have a file in which lists State and Phone numbers. Does anybody have a solution in which to take the data from col3 and place it on col2? AK 2988421640 9077467107 AK 2998266711 2069239034 AK 2983804242 2069239034 AK 2960407849 AK ... (3 Replies)
Discussion started by: liketheshell
3 Replies

9. Shell Programming and Scripting

awk - sed :Help Getting next lines data .

Experts, Can you please help how to get the output that are written just below "bad" calls badcalls nullrecv 439486 54 0 badlen xdrcall dupchecks ... (6 Replies)
Discussion started by: rveri
6 Replies

10. Shell Programming and Scripting

Trouble using awk and sed commands

Hi i have a control file which i need to read. It is ',' separated. the 3rd parameter will be ';' separated. I have 2 files: /home/orig.txt /home/join.txt I need a O/P file name based on firstparameter_1.txt and it should have the content of /home/orig.txt and appended content from... (2 Replies)
Discussion started by: Ravindra Swan
2 Replies
MSGFMT_FORMAT(3)							 1							  MSGFMT_FORMAT(3)

MessageFormatter::format - Format the message

	Object oriented style

SYNOPSIS
public string MessageFormatter::format (array $args) DESCRIPTION
Procedural style string msgfmt_format (MessageFormatter $fmt, array $args) Format the message by substituting the data into the format string according to the locale rules PARAMETERS
o $fmt - The message formatter o $args - Arguments to insert into the format string RETURN VALUES
The formatted string, or FALSE if an error occurred EXAMPLES
Example #1 msgfmt_format(3) example <?php $fmt = msgfmt_create("en_US", "{0,number,integer} monkeys on {1,number,integer} trees make {2,number} monkeys per tree"); echo msgfmt_format($fmt, array(4560, 123, 4560/123)); $fmt = msgfmt_create("de", "{0,number,integer} Affen auf {1,number,integer} Baumen sind {2,number} Affen pro Baum"); echo msgfmt_format($fmt, array(4560, 123, 4560/123)); ?> Example #2 OO example <?php $fmt = new MessageFormatter("en_US", "{0,number,integer} monkeys on {1,number,integer} trees make {2,number} monkeys per tree"); echo $fmt->format(array(4560, 123, 4560/123)); $fmt = new MessageFormatter("de", "{0,number,integer} Affen auf {1,number,integer} Baumen sind {2,number} Affen pro Baum"); echo $fmt->format(array(4560, 123, 4560/123)); ?> The above example will output: 4,560 monkeys on 123 trees make 37.073 monkeys per tree 4.560 Affen auf 123 Baumen sind 37,073 Affen pro Baum SEE ALSO
msgfmt_create(3), msgfmt_parse(3), msgfmt_format_message(3), msgfmt_get_error_code(3), msgfmt_get_error_message(3). PHP Documentation Group MSGFMT_FORMAT(3)
All times are GMT -4. The time now is 09:25 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy