1611 shaares
17 private links
17 private links
5 results
tagged
file
# Loading from __DATA__
my @hosts = <DATA>;
chomp @hosts;
# => ["coucou.com", "coco.com", "cici.com", "chichi.com", "cucu.com", "cece.com" ]
__DATA__
coucou.com
coco.com
cici.com
chichi.com
cucu.com
cece.com
# Loading from file ./hosts
use Mojo::File;
my $file = Mojo::File->new('hosts');
my @hosts = grep { $_ ne '' } grep { $_ !~ m/^#/ } split '\n', $file->slurp;
# => ["coucou.com", "coco.com", "cici.com", "chichi.com", "cucu.com", "cece.com" ]
# ./hosts
# Deals with comments and blank lines
coucou.com
coco.com
# More hosts
cici.com
chichi.com
cucu.com
cece.com
CSV & JSON convertor tool
This is a full-featured CSV parsing tool running entirely on your brower. No data leave your computer ! Use it also to learn how to use our packages and to test the various options interactively.
DownloadButton is a simple component for letting the user download a javascript-generated file. It was extracted from Notablemind.
sed
is stream editor, but can edit files directly too, with the following:
sed -i -e 's/foo/bar/g' filename
s
is used to replace the found expression "foo" with "bar"
g
stands for "global", meaning to do this for the whole line. If you leave off the g
and "foo" appears twice on the same line, only the first "foo" is changed to "bar".
-i
option is used to edit in place on filename.
-e
option indicates a command to run.