creates an empty file. Until you write data into it, it is an empty ASCII file, an empty EBCDIC file, an empty UTF-8 file, an empty ISO 8859-1 file, an empty ISO 8859-6 file, and an empty file encoded with any other codeset you choose to select.
I can't get touch to simultaneously create three empty files file1, file2, file3. I tried:$ touch filebut all I got was one file:$ fileWhat did I do wrong? (4 Replies)
Hi All,
I am checking for a empty input file to do some further action , but I am getting exit status 0 in both the cases , for empty and non empty file both.
The value of $? is coming 0 in if part also and else part too.
#!/bin/ksh
if ]; then
echo "data"
# exit 0
echo "$?"
else... (4 Replies)
Hi,
I have a file in my desktop which is a unicode format. After this file is transferred to Unix using FTP, we are seeing some special character (like rectangle box type) at the first line. The same file is saved as UTF8 (using textpad tool, selecting encode to UTF-8 option) on my desktopand... (7 Replies)
Hello all,
I'd like to replace "," by "/" in a utf8 file from postion X to Y. Comma "," is also defined as delimiter.
12345678901234567890,123456789012345,12345678901234567890,
aaaa,aaaa,aaaaa ,bbb,bbbb,bbbbb ,cccccc,cc ,
Result should be... (1 Reply)
Hi,
I am trying to write an Archive script that should look for files older than x days, zip them and move the zip to the archive directory and delete the files that have been zipped. I am not sure how i can handle this error:
"cowardly refusing to create an empty archieve".
Just wanted to know... (9 Replies)
All,
I have several *.dat files which is created in windows (ANSI Endoing) Or PC File format, once I copy those files to unix.
How can I convert those file to utf8 encoding ?
I tired iconv, it says not supported
Please help
Thanks
- S (5 Replies)
Hi,
i need a single command to create multiple empty files(no trailing lines as well) and empty the files if already existing.
please let me know or if this has been ansered, if some ocan share the link please, thanks
> newfile.txt
or
:> newfile.txt
do not work (4 Replies)
Hello Guys.
Please I would like to create empty files from a list
In file1 will be the followin values, so i will like to create for each name a empty file.
file1
2191off-r0.sps
2192off-r0.sps
2193off-r0.sps
2194off-r0.sps
2195off-r0.sps
So I need to get 5 empty files.
Thanks for... (7 Replies)
Hi all,
Is Der any unix command which will create a empty dataset ..?(in .ds ).I know we can use orchadmin dump command to view dataset data.. but how to create a dataset..?
like
sampledataset.ds
thanks in advance
hemanthsaikumar (1 Reply)
Discussion started by: hemanthsaikumar
1 Replies
LEARN ABOUT DEBIAN
template::provider::encoding
Template::Provider::Encoding(3pm) User Contributed Perl Documentation Template::Provider::Encoding(3pm)NAME
Template::Provider::Encoding - Explicitly declare encodings of your templates
SYNOPSIS
use Template::Provider::Encoding;
use Template::Stash::ForceUTF8;
use Template;
my $tt = Template->new(
LOAD_TEMPLATES => [ Template::Provider::Encoding->new ],
STASH => Template::Stash::ForceUTF8->new,
);
# Everything should be Unicode
# (but you can pass UTF-8 bytes as well, thanks to Template::Stash::ForceUTF8)
my $author = "x{5bae}x{5ddd}";
# this will emit Unicode flagged string to STDOUT. You might
# probably want to binmode(STDOUT, ":encoding($enccoding)")
# before process() call
$tt->process($template, { author => $author });
# in your templates
[% USE encoding 'utf-8' -%]
My name is [% author %]. { ... whatever UTF-8 bytes }
DESCRIPTION
Template::Provider::Encoding is a Template Provider subclass to decode template using its declaration. You have to declare encoding of the
template in the head (1st line) of template using (fake) encoding TT plugin. Otherwise the template is handled as utf-8.
[% USE encoding 'utf-8' %]
Here comes utf-8 strings with [% variable %].
DIFFERNCE WITH OTHER WAYS
UNICODE option and BOM
Recent TT allows "UNICODE" option to Template::Provider and by adding it Provider scans BOM (byte-order mark) to detect UTF-8/UTF-16
encoded template files. This module does basically the same thing in a different way, but IMHO adding BOM to template files is a little
painful especially for non-programmers.
Template::Provider::Encode
Template::Provider::Encode provides a very similar way to detect Template file encodings and output the template into various encodings.
This module doesn't touch output encoding of the template and instead it emits valid Unicode flagged string. I think the output encoding
conversion should be done by other piece of code, especially in the framework.
This module doesn't require you to specify encoding in the code, nor doesn't guess encodings. Instead it forces you to put "[% USE encoding
'foo-bar' %]" in the top of template files, which is explicit and, I think, is a good convention.
AUTHOR
Tatsuhiko Miyagawa <miyagawa@bulknews.net>
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
SEE ALSO
Template::Stash::ForceUTF8, Template::Provider::Encode
perl v5.12.3 2007-08-01 Template::Provider::Encoding(3pm)