Sponsored Content
Top Forums Shell Programming and Scripting search-word-print-specific-string Post 302491667 by Jassz on Friday 28th of January 2011 03:13:29 AM
Old 01-28-2011
search-word-print-specific-string

Hi,
Our input xml looks like:
Code:
<doc>
  <str name="account_id">1111</str>
  <str name="prd_id">DHEP155EK</str>
  </doc>
- <doc>
  <str name="account_id">6666</str>
  <str name="prd_id">394531662</str>
  </doc>
- <doc>
  <str name="account_id">6666</str>
  <str name="prd_id">394805955</str>
  </doc>

here we want to get the account_id|prd_id to another text file, output.txt like:
Code:
1111|DHEP155EK
6666|394531662
6666|394805955

Can anyone help us with the unix command for this?
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Print lines with search string at specific position

Hi Folks, I have a file with all fields defined by byte position, but any field can be empty so I cannot print lines based on a search of specific columns. I need to print all lines of this file where the string of two characters at byte position 100-101 contains the number 27. Any ideas? ... (4 Replies)
Discussion started by: HealthyGuy
4 Replies

2. Shell Programming and Scripting

search a word and print specific string using awk

Hi, I have list of directory paths in a variable and i want to delete those dirs and if dir does not exist then search that string and get the correct path from xml file after that delete the correct directory. i tried to use grep and it prints the entire line from the search.once i get the entire... (7 Replies)
Discussion started by: dragon.1431
7 Replies

3. Shell Programming and Scripting

awk or sed command to print specific string between word and blank space

My source is on each line 98.194.245.255 - - "GET /disp0201.php?poc=4060&roc=1&ps=R&ooc=13&mjv=6&mov=5&rel=5&bod=155&oxi=2&omj=5&ozn=1&dav=20&cd=&daz=&drc=&mo=&sid=&lang=EN&loc=JPN HTTP/1.1" 302 - "-" "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Trident/4.0; .NET CLR 1.0.3705; .NET CLR... (5 Replies)
Discussion started by: elamurugu
5 Replies

4. UNIX for Dummies Questions & Answers

Script to search for a particular word in files and print the word and path name

Hi, i am new to unix shell scripting and i need a script which would search for a particular word in all the files present in a directory. The output should have the word and file path name. For example: "word" "path name". Thanks for the reply in adv,:) (3 Replies)
Discussion started by: virtual_45
3 Replies

5. Shell Programming and Scripting

break the string and print it in a new line after a specific word

Hi Gurus I am new to this forum.. I am using HP Unix OS. I have one single string in input file as shown below Abc123 | cde | fgh | ghik| lmno | Abc456 |one |two |three | four | Abc789 | five | Six | seven | eight | Abc098 | ........ I want to achive the result in a output file as shown... (3 Replies)
Discussion started by: kannansr621
3 Replies

6. Shell Programming and Scripting

Search string in unix and print whole matching word

Hi I have requirement to search string starting with specific characters and print whole matching word in that string. example mystr="ATTRIBUTE NAME="Event Name" VALUE="Execute"" I want to search by passing "NAME=" and result should be NAME="Event Name". i am using below command but... (3 Replies)
Discussion started by: tmalik79
3 Replies

7. UNIX for Dummies Questions & Answers

How to print line starts with specific word and contains specific word using sed?

Hi, I have gone through may posts and dint find exact solution for my requirement. I have file which consists below data and same file have lot of other data. <MAPPING DESCRIPTION ='' ISVALID ='YES' NAME='m_TASK_UPDATE' OBJECTVERSION ='1'> <MAPPING DESCRIPTION ='' ISVALID ='NO'... (11 Replies)
Discussion started by: tmalik79
11 Replies

8. Shell Programming and Scripting

[Solved] Search for a word and print the next word

Hi, I am trying to search for a word and print the next word. For example: My text is "<TRANSFORMATION TYPE ="Lookup Procedure">" I am searching for "TYPE" and trying to print ="Lookup Procedure" I have written a code like following: echo $line | nawk... (4 Replies)
Discussion started by: sampoorna
4 Replies

9. Shell Programming and Scripting

How to print multiple specific column after a specific word?

Hello.... Pls help me (and sorry my english) :) So I have a file (test.txt) with 1 long line.... for example: isgc jsfh udgf osff 8462 error iwzr 653 idchisfb isfbisfb sihfjfeb isfhsi gcz eifh How to print after the "error" word the 2nd 4th 5th and 7th word?? output well be: 653 isfbisfb... (2 Replies)
Discussion started by: marvinandco
2 Replies

10. Shell Programming and Scripting

Search for a specific word and print only the word from the input file

Hi, I have a sample file as shown below, I am looking for sed or any command which prints the complete word only from the input file. Ex: $ cat "sample.log" I am searching for a word which is present in this file We can do a pattern search using grep but I need to cut only the word which... (1 Reply)
Discussion started by: mohan_kumarcs
1 Replies
curvetun(8)                                                     netsniff-ng-toolkit                                                    curvetun(8)

NAME
curvetun - lightweight curve25519-based multiuser IP tunnel SYNOPSIS
curvetun [-d|--dev <tun>][-x|--export][-C|--dumpc][-S|--dumps] [-k|--keygen][-c|--client [<alias>]][-s|--server][-N|--no-logging] [-p|--port <num>][-t|--stun <server>][-4|--ipv4][-6|--ipv6] [-v|--version][-h|--help] DESCRIPTION
curvetun embeds a client and a server to build and manage multiuser IP tunnels using Elliptic Curve Cryptography (ECC) EXAMPLES
curvetun --keygen Generate public/private keypair. This needs to be done before to get things started. curvetun --export Export public data to remote servers curvetun --server -4 -u -N --port 6666 --stun stunserver.org Start a UDP IPv4 curvetun server on port 6666. Use stunserver.org as STUN server. curvetun --client=ethz Start curvetun client using the profile called 'ethz' OPTIONS
-k|--keygen Generate public/private keypair. -x|--export Export your public data for remote servers. -C|--dumpc Dump parsed clients. -S|--dumps Dump parsed servers. -D|--nofork Do not daemonize. -d|--dev <tun> Networking tunnel device, e.g. tun0. -c|--client [<alias>] Client mode, server alias optional. -s|--server Server mode. -N|--no-logging Disable server logging (for better anonymity). -p|--port <num> Port number (mandatory). -t|--stun <server> Show public IP/Port mapping via STUN. -u|--udp Use UDP as carrier instead of TCP. -4|--ipv4 Tunnel devices are IPv4. -6|--ipv6 Tunnel devices are IPv6. -v|--version Print version. -h|--help Print help text and lists all options. AUTHOR
Written by Daniel Borkmann <daniel@netsniff-ng.org> and Emmanuel Roullit <emmanuel@netsniff-ng.org> DOCUMENTATION
Documentation by Emmanuel Roullit <emmanuel@netsniff-ng.org> BUGS
Please report bugs to <bugs@netsniff-ng.org> 2012-06-29 curvetun(8)
All times are GMT -4. The time now is 05:24 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy