Search Results

Search: Posts Made By: my_Perl
912
Posted By Don Cragun
After more than 100 posts, we would hope that you...
After more than 100 posts, we would hope that you are starting to learn from the help the volunteers here have provided on your earlier questions.

What code have you written to try to solve this...
2,656
Posted By RudiC
Please use code tags as required by forum rules! ...
Please use code tags as required by forum rules!

Any attempts/ideas/thoughts from your side? Your strategy is not too clear. Why the "two script" approach? Why a .sh (shell) script to be called...
2,745
Posted By Corona688
Yet again: Show the input you have, and show the...
Yet again: Show the input you have, and show the output you want.

Show representative, input and representative output, which have something to do with each other.

We can't tell what you're...
2,018
Posted By Don Cragun
I'm glad to hear that I understood part of your...
I'm glad to hear that I understood part of your original requirements.

Does the code I suggested work for you?

What do you consider to be duplicated text? If I didn't guess correctly, please...
2,018
Posted By Don Cragun
There wasn't any duplicate text in your sample...
There wasn't any duplicate text in your sample input file. And, it isn't clear if you want to remove text that is duplicated or if you want to remove text along with the opening and closing XML...
2,018
Posted By cgkmal
You're rigth. Please use instead. awk...
You're rigth. Please use instead.


awk 'BEGIN{RS=">\n"} NF>=8{print $0">"}' file

Regards
2,018
Posted By cgkmal
Hi my_Perl, You can try: awk...
Hi my_Perl,

You can try:
awk 'BEGIN{RS=">\n"} NF>=8{print}' file
Regards
2,018
Posted By Don Cragun
What operating system and shell are you using? ...
What operating system and shell are you using?

What have you tried?
1,361
Posted By RudiC
Your request is by no means clear, and the sample...
Your request is by no means clear, and the sample doesn't help. Do I read it correct that you want to reduce the number of spaces between any non-space chars by one? Trysed 's/ \( *\)/\1/g' file
1,414
Posted By RudiC
Did you use <space><TAB>|<TAB><space> in the sub...
Did you use <space><TAB>|<TAB><space> in the sub call?

But, I found that even though that replaced your field separator patterns with single <TAB>s and fixed fields 1 and/or 2 by removing spaces,...
1,414
Posted By RudiC
How about adding {sub (/ | /, "\t"); before...
How about adding {sub (/ | /, "\t"); before splitting $2 in "SEARCH.TXT"?
1,454
Posted By drl
Hi. I like awk scripts, but I also like...
Hi.

I like awk scripts, but I also like generality, as long as it's not difficult or complicated. If the files are formatted nicely into lines as shown in the OP, then basic awk scripts are fine....
1,454
Posted By Don Cragun
In case you have text between tags on the same...
In case you have text between tags on the same line as text with tags, you could also try:
awk '{gsub(/<[^>]*>/, "")}$0!=""' INPUT.TXT
Note that this code (and the code RavinderSingh13 suggested)...
1,454
Posted By RavinderSingh13
Hello my_Perl, You could try following for...
Hello my_Perl,

You could try following for same.

awk '($0 !~ /</ && $0 !~ />/)' Input_file
Output will be as follows.

Relative Size Capital
Los , Monday
The first para consists of this...
2,810
Posted By Klasform
sed -e ':L' -e '/\./{p;d;}' -e 's/^ //' -e...
sed -e ':L' -e '/\./{p;d;}' -e 's/^ //' -e 'N;s/\n/ /;bL'

Ah git it!!
2,810
Posted By Klasform
sed -e ':L' -e '/\./{p;d;}' -e 's/^ //' -e...
sed -e ':L' -e '/\./{p;d;}' -e 's/^ //' -e 'N;s/\n/ /;bL'

Will do the trick!

---------- Post updated at 04:46 PM ---------- Previous update was at 04:44 PM ----------

Sorry, new here--
...
2,810
Posted By MadeInGermany
sed -e ':L' -e '/\./{p;d;}' -e 'N;s/\n/ /;bL'...
sed -e ':L' -e '/\./{p;d;}' -e 'N;s/\n/ /;bL' filelabel L
If there is . then print, delete and next cycle.
Append Next line (with embedded \n), substitute the \n by a space, jump to label L
With...
1,414
Posted By RudiC
Try awk ' NR==FNR {if (5 == split ($2, T, "...
Try awk '

NR==FNR {if (5 == split ($2, T, " ")) PAT[$2]=$1
next
}

{for (j=0; j<NF; j+=5) {TMP = ""
MIN = 1E100
...
2,745
Posted By Corona688
I apologize for the bug, I had a variable naming...
I apologize for the bug, I had a variable naming conflict.

$ awk -f xml.awk -e '(TAGS ~ /^TEXT/) {
printf("{{Text_ID=%s}}{{From=%s}}\n",ARGS["TEXT_ID"],ARGS["FROM"]);
NN=$0 ;...
2,745
Posted By Corona688
Here is my generic XML script which I use for...
Here is my generic XML script which I use for such things...

$ cat xml.awk

BEGIN {
FS=">"; OFS=">";
RS="<"; ORS="<"
}

# These should be special variables for match() but...
2,745
Posted By Corona688
I see you've updated it and made them...
I see you've updated it and made them different... but you've only made it MORE confusing, since the output ignores the different text from file 2 and just uses the XML. What, exactly, is file 2...
2,745
Posted By cjcox
Are you really just parsing/filtering the first...
Are you really just parsing/filtering the first file? Or did I miss something?
2,745
Posted By Corona688
The two files seem to have an awful lot in...
The two files seem to have an awful lot in common... what is the second file really needed for?
1,157
Posted By wisecracker
I am missing something... There is no ...
I am missing something...
There is no use_code="xxxx"> but use_count="xxxx"> instead.
I assume this is a typo, if so take care as it throws the rest of us...
What have you tried so far?
How...
2,594
Posted By RudiC
Well, then it'd be time to post OS & grep...
Well, then it'd be time to post OS & grep version, as it worked for me exactly as posted.
Showing results 1 to 25 of 40

 
All times are GMT -4. The time now is 11:25 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy