Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Recent content by cnycsjohn

  1. cnycsjohn

    create page from csv

    Hello :) I'm looking to generate a document based on a csv file. I suck at perl, and am learning as I go. Here's what I have thus far.... #!perl -w # open the csv for reading. open(IPF,"csvinput.txt") or die "Failed to open csv file, $!\n"; # while info come from the IPF handle...
  2. cnycsjohn

    Perl mass cut and paste into template

    #!/usr/bin/perl -w use strict; #local $/; # slurp mode my @html_files = glob("*.html") or die "can't open directory $!\n"; my $new_folder = 'theoutput/'; my $StartTags = "\<td width=\"200\"\>\<font face=\"Arial\" size=\"2\" color=\"Maroon\"\>"; my $EndTags = "\<\/body\>"; my $template1 =...
  3. cnycsjohn

    Perl mass cut and paste into template

    the above worked to get the raw data out.
  4. cnycsjohn

    Perl mass cut and paste into template

    #!/usr/bin/perl -w use strict; #local $/; # slurp mode my @html_files = glob("*.html") or die "can't open directory $!\n"; my $new_folder = 'theoutput/'; my $StartTags = "\<td width=\"200\"\>\<font face=\"Arial\" size=\"2\" color=\"Maroon\"\>"; my $EndTags = "\<\/body\>"; print "\n"...
  5. cnycsjohn

    Perl mass cut and paste into template

    #!/usr/bin/perl -w use strict; #local $/; # slurp mode my @html_files = glob("*.html") or die "can't open directory $!\n"; my $new_folder = 'theoutput/'; foreach my $original_doc (@html_files) { print "Processing $original_doc\n"; my $new_file = "$new_folder$original_doc"...
  6. cnycsjohn

    Perl mass cut and paste into template

    #!/usr/bin/perl -w use strict; #local $/; # slurp mode my @html_files = glob("~/perltest/*.html") or die "can't open directory $!\n"; my $new_folder = 'theoutput/'; foreach my $doc (@html_files) { print "Processing $doc\n"; my $new_file = "$new_folder$doc"; open...
  7. cnycsjohn

    Perl mass cut and paste into template

    Someone on another forum said : "You'll eventually be matching HTML tags. Will these ever change or will they always be exactly as you've posted them? If they're likely to be any different at any stage, you'd probably be better off using a proper tag-aware HTML parser (such as...
  8. cnycsjohn

    Perl mass cut and paste into template

    Also, can someone explain what the /gm and /gms actually mean? I'm guessing my foreach statement is lacking a step?
  9. cnycsjohn

    Perl mass cut and paste into template

    #!/usr/bin/perl -w use strict; #local $/; # slurp mode my @htmlFiles = glob("~/perltest/*.html") or die "can't open directory $!\n"; foreach my $c(@htmlFiles){ open (HTML, $c); #for ( $linesFromFile ) { if ( /^StartTags/gm .. /^EndTags/gm ) { print $1 > "~/folder2/$c"; #} }}...
  10. cnycsjohn

    Perl mass cut and paste into template

    #!/usr/bin/perl -w use strict; #local $/; # slurp mode my @htmlFiles = glob("$~/perltest/*.html") or die "can't open directory $!\n"; foreach my $c(@htmlFiles){ open (HTML, $c); #for ( $linesFromFile ) { if ( /^StartTags/gm .. /^EndTags/gm ) { print $1 > "~/folder2/$c"; #} }}...
  11. cnycsjohn

    Perl mass cut and paste into template

    [jmackenz@phoenix perltest]$ perl removedata.pl Global symbol "$linesFromFile" requires explicit package name at removedata.pl line 14. Execution of removedata.pl aborted due to compilation errors.
  12. cnycsjohn

    Perl mass cut and paste into template

    does that look a little more in the right direction ? at least for stage 1 of the issue , getting raw data out
  13. cnycsjohn

    Perl mass cut and paste into template

    #!/usr/bin/perl -w use strict; #local $/; # slurp mode my @htmlFiles = glob($pathToFiles/*.html) or die "can't open directory $!\n"; foreach my $c(@htmlFiles){ open (HTML, $c); for ( $linesFromFile ) { if ( /^StartTags/gm .. /^EndTags/gm ) { print > /folder2/$c; } }
  14. cnycsjohn

    Perl mass cut and paste into template

    To make things simpler I'm thinking I can just take everything between <td width="200"><font face="Arial" size="2" color="Maroon"> and </body>
  15. cnycsjohn

    Perl mass cut and paste into template

    Thanks for the info :) To be a little more clear , I have 385 files that have data contained between the following : <table><tr> <td width="200"><font face="Arial" size="2" color="Maroon"> and </table> </center> </body> </html> I'd like to Insert the text between two editable region...

Part and Inventory Search

Back
Top