aboutsummaryrefslogtreecommitdiffstats
path: root/calendar
diff options
context:
space:
mode:
authorMatthew Lemon <y@yulqen.org>2023-10-04 15:42:40 +0100
committerMatthew Lemon <y@yulqen.org>2023-10-04 15:42:40 +0100
commit1c322f04a970d2573a863d01b2c9d360dfaab19a (patch)
tree4932e2333f7413f62f2b2e262d4a35f279b6419b /calendar
parenta164aafde81e9bfdc548d2fa57b3f73194d99f87 (diff)
parentccfe3181e74227dc8c8ad4b43fa7e4df77bb5b2b (diff)
Merge branch 'master' of github.com:yulqen/perlscripts
Diffstat (limited to 'calendar')
-rwxr-xr-xcalendar/dayplan_revised.pl26
1 files changed, 26 insertions, 0 deletions
diff --git a/calendar/dayplan_revised.pl b/calendar/dayplan_revised.pl
index 862b191..fccc5cc 100755
--- a/calendar/dayplan_revised.pl
+++ b/calendar/dayplan_revised.pl
@@ -5,6 +5,32 @@ use strict;
use warnings;
use DateTime;
use JSON;
+use Archive::Tar;
+use IO::Zlib;
+
+sub search_in_tgz {
+ my ($archive_file, $search_string) = @_;
+ my $tar = Archive::Tar->new;
+ $tar->read($archive_file);
+ # Iterate through the files in the archive in memory
+ foreach my $file ($tar->get_files) {
+ # Check if the file matches your filter (e.g., .txt extension)
+ if ($file->name =~ /\.md$/) {
+ # Get the content of the file and process it as needed
+ my $file_content = $file->get_content;
+
+ # Perform your desired operations on $file_content
+ # For example, you can print it or manipulate it here
+
+ my @lines = split(/\n/, $file_content);
+ foreach my $line (@lines) {
+ if ($line =~ /$search_string/) {
+ print "File name: " . $file->name . ": " . $line . "\n";
+ }
+ }
+ }
+ }
+}
my $dayplans = '/home/lemon/Documents/Notes/journal/day_plans';
#my $dayplans = "/tmp/dayplans";