03-13-2013
Please post your master file and reference file again using code tags.
From above it not clear.
And please post desired output also.
Regards,
pamu
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi All,
How do I search first string & second string and copy all content between them from one file to another file?
Please help me..
Thanks In Advance.
Regards,
Pankaj (12 Replies)
Discussion started by: pankajp
12 Replies
2. Shell Programming and Scripting
Hi,
I have a folder which contains multiple config.xml files and one input file, Please see the below format.
Config Files format looks like :-
Code:
<application name="SAMPLE-ARCHIVE">
<NVPairs name="Global Variables">
<NameValuePair>
... (0 Replies)
Discussion started by: haiksuresh
0 Replies
3. Shell Programming and Scripting
I have a text (text.txt) and I would like to replace only the first 2 occurrences of a word (but I might need to replace more):
For example, if text is this:
CAR sweet head
hat red yellow
CAR book brown
tiger CAR cow CAR
CAR milk
I would like to replace the word "CAR" with word... (12 Replies)
Discussion started by: bingel
12 Replies
4. Shell Programming and Scripting
Hi All,
I need help in manipulating the data in first column in a file.
The sample data looks like below,
Mon Jul 18 00:32:52 EDT 2011,NULL,UAT
Jul 19 2011,NULL,UAT
1] All field in the file are separated by ","
2] File is having weekly data extracted from database
3] For eg.... (8 Replies)
Discussion started by: gr8_usk
8 Replies
5. Shell Programming and Scripting
Hi all.
I have the following command that is successfully searching for any one of the strings on all lines of a file and replacing it with the instructed value.
cat inputFile | awk '{gsub(/aaa|bbb|ccc|ddd/,"1234")}1' > outputFile
This does in fact replace any occurrence of aaa, bbb,... (2 Replies)
Discussion started by: dazhoop
2 Replies
6. Shell Programming and Scripting
Hello,
I'm trying the solve the following problem.
I have a file which I intend to use as a csv called master.csv
The columns are separated by commas.
I want to change the text on a specific row in either column 3,4,5 or 6 from xxx to yyy depending upon if column 1 matches a specified pattern.... (3 Replies)
Discussion started by: cyphex
3 Replies
7. Shell Programming and Scripting
Hi,
I have two files master.txt & reference.txt. Sample below
Master.txt
2372,MTS,AP
919848001104,Airtel,DL
0819,MTS,MUM
919849788001,Airtel,AP
1430,Aircel MP,20
Reference.txt
2372,919848701430,46467
919848002372,2372,47195
2372,919849788001,59027
0819,028803,1
0819,029801,1... (2 Replies)
Discussion started by: siramitsharma
2 Replies
8. Shell Programming and Scripting
I have a environment property file which contains:
Input file:
value1 = url1
value2 = url2
value3 = url3 and so on.
I need to search all *.xml files under directory for value1 and replace it with url1.
Same thing I have to do for all values mentioned in input file. I need script in unix bash... (7 Replies)
Discussion started by: Shamkamde
7 Replies
9. Shell Programming and Scripting
Hi I have a source file that looks like
a,b,c,d,e,f,g,h,t,DISTI(USD),MSRP(USD),DIST(EUR),MSRP(EUR),EMEA-DISTI(USD),EMEA-MSRP(USD),GLOBAl-DISTI(USD),GLOBAL-MSRP(USD),DISTI(GBP), MSRP(GBP)
I want to basically change MSRP(USD) to MSRP,USD and DIST(EUR) to DIST,EUR and likewise for all i'm using... (3 Replies)
Discussion started by: r_t_1601
3 Replies
10. Shell Programming and Scripting
Hi Forum.
I'm trying to cleanup the following data elements (To remove any occurences of commas and any extra spaces) while preserving the <TAB> delimiter using awk gsub but I have not been successful.
Original Data:
4365 monte des source rue,, ,<TAB>trevost<TAB>QC
Desired Data:... (1 Reply)
Discussion started by: pchang
1 Replies
LEARN ABOUT DEBIAN
text::worddiff::html
Text::WordDiff::HTML(3pm) User Contributed Perl Documentation Text::WordDiff::HTML(3pm)
Name
Text::WordDiff::HTML - XHTML formatting for Text::WordDiff
Synopsis
use Text::WordDiff;
my $diff = word_diff 'file1.txt', 'file2.txt'; { STYLE => 'HTML' };
my $diff = word_diff $string1, $string2, { STYLE => 'HTML' };
my $diff = word_diff *FH1, *FH2, { STYLE => 'HTML' };
my $diff = word_diff &reader1, &reader2, { STYLE => 'HTML' };
my $diff = word_diff @records1, @records2, { STYLE => 'HTML' };
# May also mix input types:
my $diff = word_diff @records1, 'file_B.txt', { STYLE => 'HTML' };
Description
This class subclasses Text::WordDiff::Base to provide a XHTML formatting for Text::WordDiff. See Term::WordDiff for usage details. This
class should never be used directly.
Text::WordDiff::HTML formats word diffs for viewing in a Web browser. The diff content is highlighted as follows:
o "<div class="file">"
This element contains the entire contents of the diff "file" returned by "word_diff()". All of the following elements are subsumed by
this one.
o "<span class="fileheader">"
The header section for the files being "diff"ed, usually something like:
--- in.txt Thu Sep 1 12:51:03 2005
+++ out.txt Thu Sep 1 12:52:12 2005
This element immediately follows the opening "file" "<div>" element, but will not be present if Text::WordDif cannot deterimine the
file names for both files being compared.
o "<span class="hunk">"
This element contains a single diff "hunk". Each hunk may contain the following elements:
o "<ins>"
Inserted content.
o "<del>"
Deleted content.
You may do whatever you like with these elements and classes; I highly recommend that you style them using CSS. You'll find an example CSS
file in the eg directory in the Text-WordDiff distribution.
See Also
Text::WordDiff
Text::WordDiff::ANSIColor
Support
This module is stored in an open repository at the following address:
<https://svn.kineticode.com/Text-WordDiff/trunk/>
Patches against Text::WordDiff are welcome. Please send bug reports to <bug-text-worddiff@rt.cpan.org>.
Author
David Wheeler <david@kineticode.com>
Copyright and License
Copyright (c) 2005-2008 David Wheeler. Some Rights Reserved.
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
perl v5.10.0 2009-09-24 Text::WordDiff::HTML(3pm)