Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6180873
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T00:55:19+00:00 2026-05-24T00:55:19+00:00

#!/usr/bin/perl while (true) { #Obj: open dir, get flat-file which was exported from bteq

  • 0
#!/usr/bin/perl

while (true) {
#Obj: open dir, get flat-file which was exported from bteq and send to a fastload script to be loaded into dev
    opendir (DIR, "C:/q2refresh/") or die "Cannot open /my/dir: $!\n"; #open directory with the flat-file
    my @Dircontent = readdir DIR;
    $filetobecopied = "C:/q2refresh/q2_refresh_prod_export.txt";  #flatfile exported from bteq
    $newfile = "C:/q2refresh/Q2_FastLoadFromFlatFile.txt"; #new file flat-file contents will be copied to as "fastload"
    copy($filetobecopied, $newfile) or die "File cannot be copied.";
    close DIR;
    my $items_in_dir = @Dircontent;
        if ($items_in_dir > 1) {  # check for new files written to the directory
>>>>          # take the copied FlatFile above and import into a fastload script  located at C:/q2refresh/q2Fastload.txt
        else {sleep 100;} #if found nothing new in directory, do nothing.
        }
}

open SOURCE, $newfile;  #reading to file
open SINK, '>>C:/q2refresh/q2Fastload.txt';   #writing to file
    while (<SOURCE>) {
        print SINK $_;
    }
close SOURCE;
close SINK;

Please see section above where I put this: “>>>>” . I am trying to perform that task of copying the content of a flat-file and importing the contents of that into a fastload script.

Is this possible in Perl, if so, how?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T00:55:19+00:00Added an answer on May 24, 2026 at 12:55 am

    Would you not just do $result=`cat fileA.txt >> fileB.txt;`.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

#!usr/bin/perl $file_name = file.txt; open(FILE,$file_name); while(<FILE>) { my $line = $_; if($line =~ m/Svr\b/)
#!usr/bin/perl use strict; use warnings; my $file_name = rem.txt; open(FILE, $file_name); while (<FILE>) {
I have the follwoing script #!/usr/bin/perl open IN, /tmp/file; s/(.*)=/$k{$1}++;$1$k{$1}=/e and print while <IN>;
#!usr/bin/perl @array = (); open(myfile,sometext.txt); while(<myfile>) { chomp; push(@array,[split( )]); } close(myfile); print @array[0];
#!/usr/bin/perl use strict; use warnings; open(TEST, leet.txt) or die Can't open leet.txt: $!\n; while(my
#!/usr/bin/perl open(SARAN,first.txt) or die Can't Open: $!\n; while($line=<SARAN>) { print $line\n; } close SARAN;
#!/usr/bin/perl -w use strict; open (EVENTLOGFILE, <eventlog.txt) || die(Could not open file eventlog file);
Perl question for you: #!/usr/bin/perl use File::Find; #Find files find(\&wanted, $dir); sub wanted {
is there a way to get with printf colored output? #!/usr/bin/perl use warnings; use
#!/usr/bin/perl use strict; use warnings; open(my $vmstat, /usr/bin/vmstat 1 2>&1 |); open(my $foo, >,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.