Create Junck Output file

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • skbaskar
    New Member
    • Jul 2007
    • 5

    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

    [code=perl]open (IN, "c:/Unicode.xml") or die "Cannot open the xml File $!\n";
    open (OUT, ">c:/Unicode.txt") or die "Cannot Create the text File $!\n";
    binmode OUT;
    while(<IN>)
    {
    $_ =~ s/\$/<Start>/ig;
    print OUT $_;
    }
    close(IN);
    close(OUT);[/code]

    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.
    Last edited by numberwhun; Oct 22 '07, 11:35 AM. Reason: add code tags
  • numberwhun
    Recognized Expert Moderator Specialist
    • May 2007
    • 3467

    #2
    Originally posted by skbaskar
    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

    [code=perl]open (IN, "c:/Unicode.xml") or die "Cannot open the xml File $!\n";
    open (OUT, ">c:/Unicode.txt") or die "Cannot Create the text File $!\n";
    binmode OUT;
    while(<IN>)
    {
    $_ =~ s/\$/<Start>/ig;
    print OUT $_;
    }
    close(IN);
    close(OUT);[/code]

    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

    Comment

    • skbaskar
      New Member
      • Jul 2007
      • 5

      #3
      Originally posted by numberwhun
      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

      Comment

      • numberwhun
        Recognized Expert Moderator Specialist
        • May 2007
        • 3467

        #4
        Originally posted by skbaskar
        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

        Comment

        • skbaskar
          New Member
          • Jul 2007
          • 5

          #5
          Originally posted by numberwhun
          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.c om/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

          Comment

          • eWish
            Recognized Expert Contributor
            • Jul 2007
            • 973

            #6
            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.

            Comment

            • KevinADC
              Recognized Expert Specialist
              • Jan 2007
              • 4092

              #7
              Originally posted by eWish
              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.

              Comment

              • KevinADC
                Recognized Expert Specialist
                • Jan 2007
                • 4092

                #8
                eWish
                Moderator

                I see Jeff talked you into it. My deepest sympathies Kevin. ;)

                Comment

                • eWish
                  Recognized Expert Contributor
                  • Jul 2007
                  • 973

                  #9
                  Originally posted by KevinADC
                  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

                  Comment

                  • KevinADC
                    Recognized Expert Specialist
                    • Jan 2007
                    • 4092

                    #10
                    Luck.

                    So when I tell some real ******* ******* to go **** himself you're going to edit my post?

                    Comment

                    • lokeshrajoria
                      New Member
                      • Jun 2007
                      • 35

                      #11
                      hello ,
                      i think this is a professional site.

                      Regards
                      Lokii
                      Last edited by eWish; Oct 23 '07, 12:59 PM. Reason: Removed Quote

                      Comment

                      • KevinADC
                        Recognized Expert Specialist
                        • Jan 2007
                        • 4092

                        #12
                        Originally posted by lokeshrajoria
                        hello ,
                        i think this is a professional site.

                        Regards
                        Lokii

                        Yes it is. I am joking with eWish.

                        Comment

                        • eWish
                          Recognized Expert Contributor
                          • Jul 2007
                          • 973

                          #13
                          Originally posted by KevinADC
                          Yes it is. I am joking with eWish.
                          I saw the humor trust me....:)

                          Comment

                          • KevinADC
                            Recognized Expert Specialist
                            • Jan 2007
                            • 4092

                            #14
                            Originally posted by eWish
                            I saw the humor trust me....:)
                            I never doubted you wouldn't. :-D

                            Comment

                            Working...