473,386 Members | 1,775 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Create Junck Output file

Hi All,

I have one xml file and i want to change some text in that file for that i am using the following perl code

Expand|Select|Wrap|Line Numbers
  1. open (IN, "c:/Unicode.xml") or die "Cannot open the xml File $!\n";
  2. open (OUT, ">c:/Unicode.txt") or die "Cannot Create the text File $!\n";
  3. binmode OUT;
  4. while(<IN>)
  5. {       
  6.         $_ =~ s/\$/<Start>/ig;
  7.         print OUT $_;
  8. }
  9. close(IN);
  10. close(OUT);
But the output(Unicode.txt) file having lot of junck characters where i replaced and i thought that the xml file in some unicode format may be.

Please help me to solve this problem.

Thanks in advance
Baskar K.
Oct 22 '07 #1
13 1532
numberwhun
3,509 Expert Mod 2GB
Hi All,

I have one xml file and i want to change some text in that file for that i am using the following perl code

Expand|Select|Wrap|Line Numbers
  1. open (IN, "c:/Unicode.xml") or die "Cannot open the xml File $!\n";
  2. open (OUT, ">c:/Unicode.txt") or die "Cannot Create the text File $!\n";
  3. binmode OUT;
  4. while(<IN>)
  5. {       
  6.         $_ =~ s/\$/<Start>/ig;
  7.         print OUT $_;
  8. }
  9. close(IN);
  10. close(OUT);
But the output(Unicode.txt) file having lot of junck characters where i replaced and i thought that the xml file in some unicode format may be.

Please help me to solve this problem.

Thanks in advance
Baskar K.
First, can you please supply a sample of the original file, and then a sample of the new file with the "junk" characters? We really need to see what you are referring to.

Have you checked out on CPAN any of the modules up there for working with XML files? Its always a good idea to check CPAN for modules that will help you do your task easier.

Regards,

Jeff
Oct 22 '07 #2
First, can you please supply a sample of the original file, and then a sample of the new file with the "junk" characters? We really need to see what you are referring to.

Have you checked out on CPAN any of the modules up there for working with XML files? Its always a good idea to check CPAN for modules that will help you do your task easier.

Regards,

Jeff
Hi Jeff,

Thanks for your immediate reply and i dont know how to attach my files with this post can you please guide me on attaching my files.

Thanks in advance
Baskar K
Oct 22 '07 #3
numberwhun
3,509 Expert Mod 2GB
Hi Jeff,

Thanks for your immediate reply and i dont know how to attach my files with this post can you please guide me on attaching my files.

Thanks in advance
Baskar K
Why not put some of the text of the file here in the thread, but in code tags? I am not sure how to attach a file, sorry.

Regards,

Jeff
Oct 22 '07 #4
Why not put some of the text of the file here in the thread, but in code tags? I am not sure how to attach a file, sorry.

Regards,

Jeff
Hi Jeff

Actually if i saveas the file again as xml its works fine but when i use the current file as it is its produce junck characters.

Please refer this url for my files http://download.35mb.com/skbaskar/

And I know that the xml file in the above url is not a well formed one and my job is to make it as well formed xml. when i try to make it as well formed one it creating junck characters.

Thanks in Advance
Baskar K
Oct 22 '07 #5
eWish
971 Expert 512MB
The way that I have attached files were to upload the files via the control panel. Making my post, then editing my post ( look for the " Additional Options" ) and attaching them that way. If there is another way, I hope that someone will tell me.
Oct 23 '07 #6
KevinADC
4,059 Expert 2GB
The way that I have attached files were to upload the files via the control panel. Making my post, then editing my post ( look for the " Additional Options" ) and attaching them that way. If there is another way, I hope that someone will tell me.

That's how it's currently done on this home-grown forum. Post a message then edit the message (within 5 minutes, might be different for moderators though) and you can attach a file. Hopefully that will be fixed when the next upgrade to the forum is complete, but nobody is holding their breath.
Oct 23 '07 #7
KevinADC
4,059 Expert 2GB
eWish
Moderator

I see Jeff talked you into it. My deepest sympathies Kevin. ;)
Oct 23 '07 #8
eWish
971 Expert 512MB
eWish
Moderator

I see Jeff talked you into it. My deepest sympathies Kevin. ;)
I am game to try most things as least once. I will say it is quite interesting. Wish me luck!

--Kevin
Oct 23 '07 #9
KevinADC
4,059 Expert 2GB
Luck.

So when I tell some real ******* ******* to go **** himself you're going to edit my post?
Oct 23 '07 #10
hello ,
i think this is a professional site.

Regards
Lokii
Oct 23 '07 #11
KevinADC
4,059 Expert 2GB
hello ,
i think this is a professional site.

Regards
Lokii

Yes it is. I am joking with eWish.
Oct 23 '07 #12
eWish
971 Expert 512MB
Yes it is. I am joking with eWish.
I saw the humor trust me....:)
Oct 23 '07 #13
KevinADC
4,059 Expert 2GB
I saw the humor trust me....:)
I never doubted you wouldn't. :-D
Oct 24 '07 #14

Sign in to post your reply or Sign up for a free account.

Similar topics

9
by: Lauren Quantrell | last post by:
Is there a way to create a text file (such as a Windows Notepad file) by using a trigger on a table? What I want to do is to send a row of information to a table where the table: tblFileData has...
2
by: David Elliott | last post by:
I can create this: ?xml version="1.0" standalone="yes" ?> <ConfigOpt> <record> <Field_1>Text # 1</Field_1> <Field_2>Text # 2</Field_2> </record> </ConfigOpt>
7
by: dog | last post by:
I've seen plenty of articles on this topic but none of them have been able to solve my problem. I am working with an Access 97 database on an NT4.0 machine, which has many Access reports. I...
4
by: I_AM_DON_AND_YOU? | last post by:
There is one more problem I am facing but didn't get the solution. In my Setup Program I am not been able to create 2 things (when the program is intalled on the client machine ) : (1) create...
3
by: Dhananjayan | last post by:
Hi, I have a java webservice running on Axis, Iam able to create a java client to invoke the webservice and obtain the result. But iam not able to invoke the service from .Net client.. Here are...
23
by: sandy | last post by:
I need (okay, I want) to make a dynamic array of my class 'Directory', within my class Directory (Can you already smell disaster?) Each Directory can have subdirectories so I thought to put these...
7
by: MisterPete | last post by:
How can I inherit from file but stil create an instance that writes to stdout? ----------- I'm writing a file-like object that has verbosity options (among some other things). I know I could just...
4
by: Vlad | last post by:
I am having problems using the file.create method within a function that is called when looping through an array of filepaths. If I call my function with a hardcoded file path --C:\Temp.txt the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.