08-24-2015
Script to convert text to image
Hi
Can someone help me writing a script to convert the texts in a text file into images for each token?
Thanks in advance.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
How can I redirect text data to an image (png, jpg, gif... etc) file using perl on unix solaris environment??
Please suggest.
Pooja (1 Reply)
Discussion started by: wadhwa.pooja
1 Replies
2. Programming
hi...... thanks for allowing me to start a discussion
i am collecting usb usage details of all users and convert it into csv files so that i can export it into some database..
the input text file is as follows:-
USB History Dump
by nabiy (c)2008
(1) --- Kingston DataTraveler 130 USB... (2 Replies)
Discussion started by: certteam
2 Replies
3. UNIX for Dummies Questions & Answers
Hello Gurus,
I have a text file containing nearly 12,000 tab delimited characters with 4000 rows. If the file size is small, excel can convert the text into coloumns. However, the file that I have is very big. Can some body help me in solving this problem?
The input file example,
... (6 Replies)
Discussion started by: Unilearn
6 Replies
4. Shell Programming and Scripting
Hi to all,
Some help here please.
I have a several image files (photos, jpg files), let say 100 photos, and a list of 100 different little comments in a text file, each comment for each image.
Somebody knows if I can add (like a watermark in the bottom) this text comments and how in the... (3 Replies)
Discussion started by: cgkmal
3 Replies
5. Shell Programming and Scripting
The 6th & 7th column of the text files represents date & time. I need this to be converted in julian format using command "date +%s -d <date>". I know the command, but dont know how to use it on the script
0 dbclstr-b IXT_Web Memphis_Prod_SQL_Full Memphis-Prod-SQL-Full-Application-Backup... (4 Replies)
Discussion started by: ajiwww
4 Replies
6. Shell Programming and Scripting
Hello everyone,
I have a binary file with a structure unknown. I have found 2 perl scripts that it seems to do the convertion but I get sintactic errors when I run them, may somebody test these 2 scripts please and see if really work?
One if from here... (10 Replies)
Discussion started by: Ophiuchus
10 Replies
7. Windows & DOS: Issues & Discussions
I hope someone could help me. I tried to create a barcode image using Visual Studio and then want to convert this barcode images to PDF files.
When I preview this in VS, the barcode image exists, however when converted it to pdf, it disappeared. Did I do anything wrong? :confused: (4 Replies)
Discussion started by: aspbarcode
4 Replies
8. Shell Programming and Scripting
Hi Folks,
Could you please share your ideas on extracting text from image file(jpg,png and gif formats).
Regards,
J (1 Reply)
Discussion started by: scriptscript
1 Replies
9. Shell Programming and Scripting
Hi Everyone,
I want your help to write a script which will take text file as input and on the basis of delimiter ":"script will create excel sheet.
Example input:
IpAdress:InstanceName:Port:ServerName
10.255.255.1:abc:2232:xyz_abc
Output should be an excel sheet like below:
Column... (8 Replies)
Discussion started by: akabhinav18
8 Replies
10. Web Development
I want to show a page with an image between 2 any paragraphs.
I tried the following script.
But the image is not centered.
SUSE Paste
<!DOCTYPE html>
<html>
<head>
<style>
center.center_1 {
margin: auto;
width: 60%;
... (3 Replies)
Discussion started by: jcdole
3 Replies
LEARN ABOUT DEBIAN
mkdoc::xml::tokenizer
MKDoc::XML::Tokenizer(3pm) User Contributed Perl Documentation MKDoc::XML::Tokenizer(3pm)
NAME
MKDoc::XML::Tokenizer - Tokenize XML the REX way
SYNOPSIS
my $tokens = MKDoc::XML::Tokenizer->process_data ($some_xml);
foreach my $token (@{$tokens})
{
print "'" . $token->as_string() . "' is text
" if (defined $token->text());
print "'" . $token->as_string() . "' is a self closing tag
" if (defined $token->tag_self_close());
print "'" . $token->as_string() . "' is an opening tag
" if (defined $token->tag_open());
print "'" . $token->as_string() . "' is a closing tag
" if (defined $token->tag_close());
print "'" . $token->as_string() . "' is a processing instruction
" if (defined $token->pi());
print "'" . $token->as_string() . "' is a declaration
" if (defined $token->declaration());
print "'" . $token->as_string() . "' is a comment
" if (defined $token->comment());
print "'" . $token->as_string() . "' is a tag
" if (defined $token->tag());
print "'" . $token->as_string() . "' is a pseudo-tag (NOT text and NOT tag)
" if (defined $token->pseudotag());
print "'" . $token->as_string() . "' is a leaf token (NOT opening tag)
" if (defined $token->leaf());
}
SUMMARY
MKDoc::XML::Tokenizer is a module which uses Robert D. Cameron REX technique to parse XML (ignore the carriage returns):
[^<]+|<(?:!(?:--(?:[^-]*-(?:[^-][^-]*-)*->?)?|[CDATA[(?:[^]]*](?:[^]]+])
*]+(?:[^]>][^]]*](?:[^]]+])*]+)*>)?|DOCTYPE(?:[
]+(?:[A-Za-z_:]|[^
x00-x7F])(?:[A-Za-z0-9_:.-]|[^x00-x7F])*(?:[
]+(?:(?:[A-Za-z_:]|[^
x00-x7F])(?:[A-Za-z0-9_:.-]|[^x00-x7F])*|"[^"]*"|'[^']*'))*(?:[
]+)
?(?:[(?:<(?:!(?:--[^-]*-(?:[^-][^-]*-)*->|[^-](?:[^]"'><]+|"[^"]*"|'[^']*'
)*>)|?(?:[A-Za-z_:]|[^x00-x7F])(?:[A-Za-z0-9_:.-]|[^x00-x7F])*(?:?>|[
n
][^?]*?+(?:[^>?][^?]*?+)*>))|%(?:[A-Za-z_:]|[^x00-x7F])(?:[A-Za-z0
-9_:.-]|[^x00-x7F])*;|[
]+)*](?:[
]+)?)?>?)?)?|?(?:(?:[A-Za-z
_:]|[^x00-x7F])(?:[A-Za-z0-9_:.-]|[^x00-x7F])*(?:?>|[
][^?]*?+(?
:[^>?][^?]*?+)*>)?)?|/(?:(?:[A-Za-z_:]|[^x00-x7F])(?:[A-Za-z0-9_:.-]|[^x
00-x7F])*(?:[
]+)?>?)?|(?:(?:[A-Za-z_:]|[^x00-x7F])(?:[A-Za-z0-9_:.
-]|[^x00-x7F])*(?:[
]+(?:[A-Za-z_:]|[^x00-x7F])(?:[A-Za-z0-9_:.-]|
[^x00-x7F])*(?:[
]+)?=(?:[
]+)?(?:"[^<"]*"|'[^<']*'))*(?:[
t
]+)?/?>?)?)
That's right. One big regex, and it works rather well.
DISCLAIMER
This module does low level XML manipulation. It will somehow parse even broken XML and try to do something with it. Do not use it unless
you know what you're doing.
API
my $tokens = MKDoc::XML::Tokenizer->process_data ($some_xml);
Splits $some_xml into a list of MKDoc::XML::Token objects and returns an array reference to the list of tokens.
my $tokens = MKDoc::XML::Tokenizer->process_file ('/some/file.xml');
Same as MKDoc::XML::Tokenizer->process_data ($some_xml), except that it reads $some_xml from '/some/file.xml'.
NOTES
MKDoc::XML::Tokenizer works with MKDoc::XML::Token, which can be used when building a full tree is not necessary. If you need to build a
tree, look at MKDoc::XML::TreeBuilder.
AUTHOR
Copyright 2003 - MKDoc Holdings Ltd.
Author: Jean-Michel Hiver
This module is free software and is distributed under the same license as Perl itself. Use it at your own risk.
SEE ALSO
MKDoc::XML::Token MKDoc::XML::TreeBuilder
perl v5.10.1 2004-10-06 MKDoc::XML::Tokenizer(3pm)