IMO in most cases it is better not to use the formatting part of printf for data. Try this:
alternatively you may not need that much precision and I would suspect this might be enough:
Last edited by Scrutinizer; 02-12-2011 at 12:53 PM..
This User Gave Thanks to Scrutinizer For This Post:
Hi,
I am trying to write a script to prepare some text for use as web content.
What is happening is that all the newlines in the textfile are ignored, so I want
to be able to replace/add a few characters so that for a file containg:
This is line 1.
This is line two.
This is line four.... (1 Reply)
dear all:
maybe i have a file like :
12
34
56
78
end
how do write can i replace newline into NA :
make the file inte :
12
NA
34
NA
56
78
END (3 Replies)
Hi, for some reason I cant seem to figure this out. I have a file which looks something like this
word
word
word
word
word,word,word
word
word
word,word,word,word,word
word
word
Basically I want this whole thing to be a list with 1 word on each line like this...
word
word
word... (1 Reply)
Hi.
How to replace a text in a file with starting from a newline
example====
shashi how r u ? shashi , r u their? shashi....
shashi hello shashi
output will be
shashi how r u ?
shashi , r u their?
shashi....
shashi hello
shashi
=========
thanks in advance.. (3 Replies)
Hi all
I have the problem to substitute a string with newline in Perl. Can anybody help me?
And also how to replace a string with opening bracket (e.g. (START ) with a whitespace/null character?
Thanks in advance. (1 Reply)
Hi All,
I have the command in PERL for performing this, but Can you please suggest me how can i perform this using AWK:
My input xml file looks like this:
<aaa>hello</aaa><bbb>hai</bbb>
I want the output like this ( means need new line after end of each xml tag):
<aaa>hello</aaa>... (1 Reply)
I have output from a file like this:
15,01,11,14:06
235
I would like to change this to:
15,01,11,14:06,235
Removing newline and change to ","
I now this can be done with tr
cat OUT | tr '\n' ',''
My problem is that tr is not implemented in this shell. sed is, show it should be... (7 Replies)
I'd like to remove (do a pattern or precise replacement - this I can handle in SED using Regex )
---AFTER THE 1ST Occurrence ( i.e. on the 2nd occurrence - from the 2nd to fourth occurance ) of a specific string : type 1
-- After the 1st occurrence of 1 string1 till the 1st occurrence of... (4 Replies)
Hi,
I'm struggling with a string replacement.
I have an XML file which is in the following layout
<FUNCTION>
<PRODUCTS>
<PRODUCT CODE="PRODUCE" ACTION="amend" VALIDATE="no">
<SUPPLIER PRODUCT="PRODUCT" ACTION="amend" CODE="SUPPLIER">
<STOCK_QUANTITY DATA="21"/>
... (15 Replies)
I have a string like below:
{\rtf1\fbidis\ansi\deff0{\fonttbl{\f0\fnil\fcharset0 MS Sans Serif;}{\f1\fnil MS Sans Serif;}}
\viewkind4\uc1\pard\ltrpar\lang2057\f0\fs16 19/11/2010 SOME DESCRIPTION. \par
\lang1033\f1\par
}
I have to replace the newline character with null in the... (8 Replies)