Hello Folks ,
myfile contains 1000000 records as follows:
after run above script I got
I need it to be
I think the problem with first "sed" of mine , need to know how to remove the space between two words in double quote "String1 space String2"
I have a script that shows me the disk SPace used by different dir under my home dir:
#!/bin/ksh
cd /ednpdtu3/u01/pipe
p1=`df -g | tail -1 | tr -s " " | cut -d " " -f2`
echo "Total Disk Space of Home Dir is $p1 GB"
p2=`df -g | tail -1 | tr -s " " | cut -d " " -f3`
echo "Total Disk Space... (2 Replies)
Hi...
i need a script to remove the space before and after the operator like( / ).
Ex :
Input file
apple / manago
mango / fresh apple / fresh
Desired output:
apple/manago
mango/fresh apple/fresh
Note: betwee the desired operator space should be removed, between words do not remove... (3 Replies)
Hello
I have a file with data something like this in it :
texttexttext "text .lst" TEXT=" text "
texttexttext "moretext .lst" TEXT=" text "
Question is how do I get rid of space so that the files looks like this :
texttexttext "text.lst" TEXT="text"
texttexttext... (8 Replies)
Hi guys,
I am new to shell scripting and I have a small problem...If someone can solve this..that would be great
I am trying to form a XML by reading a flat file using shell scripting
This is my shell script
LINE_FILE1=`cat FLEX_FILE1.TXT | head -1 | tail -1`
echo... (1 Reply)
I created a awk state to calculate the number of success however when the query runs it has a leading zero. Any ideas on how to remove the leading zero from the calculation?
Here is my query:
cat myfile.log | grep | awk '{print $2,$3,$7,$11,$15,$19,$23,$27,$31,$35($19/$15*100)}'
02:00:00... (1 Reply)
Hi,
I have file which contains following lines
A| 965.|Mr.|35.45| 66.
B| 33.| a456.| 77.
The output should be
A|965|Mr.|35.45|66
B|33| a456.|77
Basically if a Number has space in prefix and . in suffix remove both.
So pattern could be if there is a | which has next two characters as... (1 Reply)
Hello,
I need help. I have xml file and there are one extra space on number <EpiReference>1 42345</EpiReference>. And of cource, the value change on every new file. I need remove space from that value what is in between <EpiReference> and </EpiReference>. How I can do that?
This are example... (9 Replies)
Perl::Critic::Policy::RegularExpressions::RequireLineBouUseryContributed PPerl::Critic::Policy::RegularExpressions::RequireLineBoundaryMatching(3)NAME
Perl::Critic::Policy::RegularExpressions::RequireLineBoundaryMatching - Always use the "/m" modifier with regular expressions.
AFFILIATION
This Policy is part of the core Perl::Critic distribution.
DESCRIPTION
Folks coming from a "sed" or "awk" background tend to assume that '$' and '^' match the beginning and end of the line, rather than then
beginning and end of the string. Adding the '/m' flag to your regex makes it behave as most people expect it should.
my $match = m{ ^ $pattern $ }x; #not ok
my $match = m{ ^ $pattern $ }xm; #ok
CONFIGURATION
This Policy is not configurable except for the standard options.
NOTES
For common regular expressions like e-mail addresses, phone numbers, dates, etc., have a look at the Regexp::Common module. Also, be
cautions about slapping modifier flags onto existing regular expressions, as they can drastically alter their meaning. See
<http://www.perlmonks.org/?node_id=484238> for an interesting discussion on the effects of blindly modifying regular expression flags.
AUTHOR
Jeffrey Ryan Thalhammer <jeff@imaginative-software.com>
COPYRIGHT
Copyright (c) 2005-2011 Imaginative Software Systems. All rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. The full text of this license
can be found in the LICENSE file included with this module.
perl v5.16.32014-0Perl::Critic::Policy::RegularExpressions::RequireLineBoundaryMatching(3)