Sponsored Content
Top Forums Shell Programming and Scripting Sed Awk Cut Grep Combination Help ? Post 302294638 by radoulov on Thursday 5th of March 2009 02:39:09 PM
Old 03-05-2009
Two questions:

1. How are the paragraphs in the first file separated? By blank lines?

2. How do the two files relate to each other: name in the first file matches content or service in the second one?
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

sed, grep, cut or combine?

I am a beginner at shell scripting, actually i am working on my first script right now. Anyway i have searched the world how to grep two letters from each word (it will always just be two words). For example: Example Blablabla I want my script to cut out Ex (from the first word) and Bl... (4 Replies)
Discussion started by: maskot
4 Replies

2. Shell Programming and Scripting

cut sed grep or other?

Hi Is there a way to cut the last two characters off a word or number given that this word or number can be of varying length? I have tried something like TEST=`echo $OLD | cut -c 1-5` where $OLD is a variable containing a number like 1234567 which gives a result of 12345. This is fine... (4 Replies)
Discussion started by: rleebife
4 Replies

3. Shell Programming and Scripting

cut in sed/awk

Hi Can i have an example where i should be able to cut columns (like for eg cut -c 1-3) in sed or awk. Regards Dhana (12 Replies)
Discussion started by: dhanamurthy
12 Replies

4. UNIX for Dummies Questions & Answers

Awk/sed solution for grep,cut

Hi, From the file "example" with lines like below, I need the int value associated with ENG , i.e, 123 SUB: ENG123, GROUP 1 SUB: HIS124, GROUP 1 .. .. Normally , i do grep ENG example | cut -d ' ' -f 2 | cut -c 4-6 Is it possible to do it in simpler way using awk/sed ? ... (5 Replies)
Discussion started by: priyam
5 Replies

5. Shell Programming and Scripting

Using grep and cut within awk

Hi My input file looks like as follows: say a.txt "aaaa cc","224 AW","ss cccccc","P06 09/10","dddddd" "aaaa cc","224 AW","ss cccccc","P06 09/10","dddddd" "aaaa cc","224 AW","ss cccccc","P06 09/10","dddddd" "aaaa cc","224 AW","ss cccccc","P06 09/10","dddddd" "aaaa cc","224 AW","ss... (5 Replies)
Discussion started by: bittoo
5 Replies

6. Shell Programming and Scripting

Advice using cut & echo combination commands

Hi, I am cutting data from a fixed length test file and then writing out a new record using the echo command, the problem I have is how to stop multiple spaces from being written to the output file as a single space. Example: cat filea | while read line do field1=`echo $line | cut -c1-2` ... (6 Replies)
Discussion started by: dc18
6 Replies

7. Shell Programming and Scripting

GREP/CUT/AWK to Arrays

hi people, I have a text file containing data, seperated by TAB. I want to process this tab'ed data as variable. how can I assign this? Ex: Code: 11aaa 12000 13aaa 14aaa 15aaa 16aaa 17aaa 21aaa 22000 23aaa 24aaa 25aaa 26aaa 27aaa 31aaa 32000 33aaa 34aaa 35aaa 36aaa 37aaa... (1 Reply)
Discussion started by: gc_sw
1 Replies

8. Shell Programming and Scripting

Using a combination of sort/cut/grep/awk/join/paste/sed

I have a file and need to only select users that have a shell of “/bin/bash” in the line using awk or sed please help (4 Replies)
Discussion started by: boyboy1212
4 Replies

9. UNIX for Dummies Questions & Answers

Print/cut/grep/sed/ date yyyymmdd on the filename only.

I have this filename "RBD_EXTRACT_a3468_d20131118.tar.gz" and I would like print out the "yyyymmdd" only. I use this command below, but if different command like cut or print....etc. Thanks ls RBD_EXTRACT* | sed 's/.*\(........\).tar.gz$/\1/' > test.txt (9 Replies)
Discussion started by: dotran
9 Replies
Frontier::RPC2(3)					User Contributed Perl Documentation					 Frontier::RPC2(3)

NAME
Frontier::RPC2 - encode/decode RPC2 format XML SYNOPSIS
use Frontier::RPC2; $coder = Frontier::RPC2->new; $xml_string = $coder->encode_call($method, @args); $xml_string = $coder->encode_response($result); $xml_string = $coder->encode_fault($code, $message); $call = $coder->decode($xml_string); $response_xml = $coder->serve($request_xml, $methods); $boolean_object = $coder->boolean($boolean); $date_time_object = $coder->date_time($date_time); $base64_object = $coder->base64($base64); $int_object = $coder->int(42); $float_object = $coder->float(3.14159); $string_object = $coder->string("Foo"); DESCRIPTION
Frontier::RPC2 encodes and decodes XML RPC calls. $coder = Frontier::RPC2->new( OPTIONS ) Create a new encoder/decoder. The following option is supported: encoding The XML encoding to be specified in the XML declaration of encoded RPC requests or responses. Decoded results may have a different encoding specified; XML::Parser will convert decoded data to UTF-8. The default encoding is none, which uses XML 1.0's default of UTF-8. For example: $server = Frontier::RPC2->new( 'encoding' => 'ISO-8859-1' ); use_objects If set to a non-zero value will convert incoming <i4>, <float>, and <string> values to objects instead of scalars. See int(), float(), and string() below for more details. $xml_string = $coder->encode_call($method, @args) `"encode_call"' converts a method name and it's arguments into an RPC2 `"methodCall"' element, returning the XML fragment. $xml_string = $coder->encode_response($result) `"encode_response"' converts the return value of a procedure into an RPC2 `"methodResponse"' element containing the result, returning the XML fragment. $xml_string = $coder->encode_fault($code, $message) `"encode_fault"' converts a fault code and message into an RPC2 `"methodResponse"' element containing a `"fault"' element, returning the XML fragment. $call = $coder->decode($xml_string) `"decode"' converts an XML string containing an RPC2 `"methodCall"' or `"methodResponse"' element into a hash containing three members, `"type"', `"value"', and `"method_name"'. `"type"' is one of `"call"', `"response"', or `"fault"'. `"value"' is array containing the parameters or result of the RPC. For a `"call"' type, `"value"' contains call's parameters and `"method_name"' contains the method being called. For a `"response"' type, the `"value"' array contains call's result. For a `"fault"' type, the `"value"' array contains a hash with the two members `"faultCode"' and `"faultMessage"'. $response_xml = $coder->serve($request_xml, $methods) `"serve"' decodes `$request_xml', looks up the called method name in the `$methods' hash and calls it, and then encodes and returns the response as XML. $boolean_object = $coder->boolean($boolean); $date_time_object = $coder->date_time($date_time); $base64_object = $coder->base64($base64); These methods create and return XML-RPC-specific datatypes that can be passed to the encoder. The decoder may also return these datatypes. The corresponding package names (for use with `"ref()"', for example) are `"Frontier::RPC2::Boolean"', `"Fron- tier::RPC2::DateTime::ISO8601"', and `"Frontier::RPC2::Base64"'. You can change and retrieve the value of boolean, date/time, and base64 data using the `"value"' method of those objects, i.e.: $boolean = $boolean_object->value; $boolean_object->value(1); $int_object = $coder->int(42); $float_object = $coder->float(3.14159); $string_object = $coder->string("Foo"); By default, you may pass ordinary Perl values (scalars) to be encoded. RPC2 automatically converts them to XML-RPC types if they look like an integer, float, or as a string. This assumption causes problems when you want to pass a string that looks like "0096", RPC2 will convert that to an <i4> because it looks like an integer. With these methods, you could now create a string object like this: $part_num = $coder->string("0096"); and be confident that it will be passed as an XML-RPC string. You can change and retrieve values from objects using value() as described above. SEE ALSO
perl(1), Frontier::Daemon(3), Frontier::Client(3) <http://www.scripting.com/frontier5/xml/code/rpc.html> AUTHOR
Ken MacLeod <ken@bitsko.slc.ut.us> perl v5.8.0 2003-01-27 Frontier::RPC2(3)
All times are GMT -4. The time now is 04:56 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy