Sponsored Content
Top Forums Shell Programming and Scripting Manipulate XML File Continous STRING by each Order Line using SHELL Post 302842215 by Pete.kriya on Thursday 8th of August 2013 04:11:54 PM
Old 08-08-2013
This is working BUT when I have a LARGE file it behaves weird

the tags are not proper in a pattern meaning

it follows pattern for 10 lines then RANDOMLY another tag gets cut off then there is a space THEN it works fine again the PATTTERN Repeats

Code:
 
<ItemOUT ........................................</ItemOut>
<ItemOUT ........................................</ItemOut>
<ItemOUT ........................................</ItemOut>
<ItemOUT ........................................</ItemOut>
<ItemOUT ............................<sometag>

............</ItemOut>
*****SPACE*****SPACE****HERE***
<ItemOUT ........................................</ItemOut>
<ItemOUT ........................................</ItemOut>
<ItemOUT ........................................</ItemOut>
<ItemOUT ........................................</ItemOut>
<ItemOUT ........................................</ItemOut>
<ItemOUT ............................<sometag>
............</ItemOut>
<ItemOUT ........................................</ItemOut>
<ItemOUT ........................................</ItemOut>
 <ItemOUT ........................................</ItemOut>
<ItemOUT ........................................</ItemOut>
 
*****SPACE*****SPACE****HERE***
 
<ItemOUT ........................................</ItemOut>
<ItemOUT ........................................</ItemOut>
 <ItemOUT ........................................</ItemOut>
<ItemOUT ............................<sometag>
............</ItemOut>
<ItemOUT ........................................</ItemOut>
<ItemOUT ........................................</ItemOut>
<ItemOUT ........................................</ItemOut>
<ItemOUT ........................................</ItemOut>


it does this for LARGE files dont know why? when I use any of sed and awk commands above

For Smaller files with 20-30 lines its ok , but with larger files it does not work..

Any advices please...
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Parse a string in XML file using shell script

Hi! I'm just new here and don't know much about shell scripting. I just want to ask for help in creating a shell script that will parse a string or value of the status in the xml file. Please sample xml file below. Can you please help me create a simple script to get the value of status? Also it... (46 Replies)
Discussion started by: ayhanne
46 Replies

2. Shell Programming and Scripting

How to remove xml namespace from xml file using shell script?

I have an xml file: <AutoData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <Table1> <Data1 10 </Data1> <Data2 20 </Data2> <Data3 40 </Data3> <Table1> </AutoData> and I have to remove the portion xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" only. I tried using sed... (10 Replies)
Discussion started by: Gary1978
10 Replies

3. Shell Programming and Scripting

How to manipulate first column and reverse the line order in third and fourth column?

How to manipulate first column and reverse the line order in third and fourth column as follws? For example i have a original file like this: file1 0.00000000E+000 -1.17555359E-001 0.00000000E+000 2.00000000E-002 -1.17555359E-001 0.00000000E+000 ... (1 Reply)
Discussion started by: Max Well
1 Replies

4. Shell Programming and Scripting

Extract File line and manipulate

How can I print a section of each line in a text file. Eg CODE1 XYR Test2 10319389 CODE2 XYR Test2 10319389 CODE3 XYR Test2 10319389 CODE4 XYR Test2 10319389 CODE5 XYR Test2 10319389 First thing that would be nice would a new file like, awk sed and substring may help but can't figure it... (6 Replies)
Discussion started by: kelseyh
6 Replies

5. Shell Programming and Scripting

Shell script to manipulate a file

Hello, I have a file with following contents : WSL SRVGRP=LISTENER SRVID=2 CLOPT="-A -t -- -n 0x0002aa050a03cc65 " RQPERM=0660 REPLYQ=Y RPPERM=0660 MIN=1 MAX=1 CONV=N I need to print only the value in Hex i.e.... (2 Replies)
Discussion started by: deo_kaustubh
2 Replies

6. Shell Programming and Scripting

Manipulate string in shell script

I am writing a shell script for some purpose. I have a variable of the form -- var1 = "policy=set policy" Now I need to manipulate the variable var to get the string after index =. that is i should have "set polcy". Also I need to to this for many other variables where the value of "=" is not... (3 Replies)
Discussion started by: Dev_Sharma987
3 Replies

7. Shell Programming and Scripting

Grep a string from input file and delete next three lines including the line contains string in xml

Hi, 1_strings file contains $ cat 1_strings /home/$USER/Src /home/Valid /home/Review$ cat myxml <projected value="some string" path="/home/$USER/Src"> <input 1/> <estimate value/> <somestring/> </projected> <few more lines > <projected value="some string" path="/home/$USER/check">... (4 Replies)
Discussion started by: greet_sed
4 Replies

8. Shell Programming and Scripting

Find string in one file and manipulate other

hi, I have 2 files delimited by "|" File 1: 1|28|ABC|11|9620034||XXX555| 29|22|ABC|11|9620258||XXX555| 51|26|ABC|11|9620314||XXX555| 77|20|ABC|11|9630506||XXX555| 97|36|ABC|11|9630562||XXX555| File 2: 9620028|I 9620034|I 9620314|S 9620332|I 9620258|I 9630506|S 9630562|S (3 Replies)
Discussion started by: pparthiv
3 Replies

9. Shell Programming and Scripting

Extract & Manipulate continous data stream-- tcpdump

Hello; I have this rather tricky problem to solve --(to me, anyways) .. I am processing the following one liner with tcpdump.. tcpdump -i T3501 -A ether host 00:1e:49:29:fc:c9 or ether host 00:1b:2b:86:ec:1b or ether host 00:21:1c:98:a4:08 and net 149.83.6.0/24 | grep --line-buffered -B... (5 Replies)
Discussion started by: delphys
5 Replies

10. Shell Programming and Scripting

How to manipulate string in line?

Hello, I looked up on google but do not know from which point to start... I am under ubuntu 18 bionic and Mainfile consists of 25K lines MainFile: Test,AAEE9FED3, GGBBDD DD AA X2d Moscow 112233445566aaBBccPPdddEE Test,AAEE9FED3, GG33DD s00022 Leningrad 11298932566aaBBccPPdddEE... (8 Replies)
Discussion started by: baris35
8 Replies
GIT-NAME-REV(1)                                                     Git Manual                                                     GIT-NAME-REV(1)

NAME
git-name-rev - Find symbolic names for given revs SYNOPSIS
git name-rev [--tags] [--refs=<pattern>] ( --all | --stdin | <commit-ish>... ) DESCRIPTION
Finds symbolic names suitable for human digestion for revisions given in any format parsable by git rev-parse. OPTIONS
--tags Do not use branch names, but only tags to name the commits --refs=<pattern> Only use refs whose names match a given shell pattern. The pattern can be one of branch name, tag name or fully qualified ref name. If given multiple times, use refs whose names match any of the given shell patterns. Use --no-refs to clear any previous ref patterns given. --exclude=<pattern> Do not use any ref whose name matches a given shell pattern. The pattern can be one of branch name, tag name or fully qualified ref name. If given multiple times, a ref will be excluded when it matches any of the given patterns. When used together with --refs, a ref will be used as a match only when it matches at least one --refs pattern and does not match any --exclude patterns. Use --no-exclude to clear the list of exclude patterns. --all List all commits reachable from all refs --stdin Transform stdin by substituting all the 40-character SHA-1 hexes (say $hex) with "$hex ($rev_name)". When used with --name-only, substitute with "$rev_name", omitting $hex altogether. Intended for the scripter's use. --name-only Instead of printing both the SHA-1 and the name, print only the name. If given with --tags the usual tag prefix of "tags/" is also omitted from the name, matching the output of git-describe more closely. --no-undefined Die with error code != 0 when a reference is undefined, instead of printing undefined. --always Show uniquely abbreviated commit object as fallback. EXAMPLE
Given a commit, find out where it is relative to the local refs. Say somebody wrote you about that fantastic commit 33db5f4d9027a10e477ccf054b2c1ab94f74c85a. Of course, you look into the commit, but that only tells you what happened, but not the context. Enter git name-rev: % git name-rev 33db5f4d9027a10e477ccf054b2c1ab94f74c85a 33db5f4d9027a10e477ccf054b2c1ab94f74c85a tags/v0.99~940 Now you are wiser, because you know that it happened 940 revisions before v0.99. Another nice thing you can do is: % git log | git name-rev --stdin GIT
Part of the git(1) suite Git 2.17.1 10/05/2018 GIT-NAME-REV(1)
All times are GMT -4. The time now is 12:25 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy