I know this should be simple but the periods in the string replacement are throwing me off.
What I want to do is replace 1.1.1.1 in my access.log file with 2.2.2.2
I have tried using 'tr' but its being thrown off by the periods and replacing all sorts of stuff in the file.
What do I need... (2 Replies)
Hi All,
I have a query on Perl. I have a text file which has 3 lines, i want to only replace the first line with my replaced text and keep the rest of the text. FOr eg
Before change -->
echo:a:pending
echo:b:pending
echo:c:pending
After change --->
echo:a:done
echo:b:pending... (1 Reply)
I'm trying to change the ramfs size in kernel .config automatically.
I have a ramfs_size file generated with du -s
cat ramfs_size
64512
I want to replace the linux .config's ramdisk size with the above value
CONFIG_BLK_DEV_RAM_SIZE=73728
Right now I'm doing something dumb like: ... (3 Replies)
I've got a web access file that I want to grep (or awk or perl or whatever will work!) out the most frequent instances of unique IP entries. Meaning the file looks something like this:
I'd like to run a sort or grep (or whatever) that will only select out the lines from IP's that had the... (7 Replies)
We have 2 file XML files - FILE1.XML and FILE2.xml - we need copy the contents of FILE1.XML and replace in FILE2.xml pattern "<assignedAttributeList></assignedAttributeList>"
FILE1.XML
1. <itemList>
2. <item type="Manufactured">
3. <resourceCode>431048</resourceCode>
4. ... (0 Replies)
Hi I have some script like this:
perl -i -p0e 's/"keyword1-.*?"/"keyword2"/s' file
to replace some keyword, but it replaces only the first instance of the keyword
how can i get it to replace all instances?
thanks! (2 Replies)
I need to replace all filesnames in a folder as well as its content from AK6 to AK11. Eg Folder has files AK6-Create.xml, AK6-system.py etc.. the files names as well as contents should be changes to AK9-Create.xml, AK9-system.py etc
All files are xml and python scripts.
---------- Post... (0 Replies)
I need to get the names of files which are starting with a string testfile. Also i want to create a XML file in the same location and write these file names into the XML.
Ex:
<path>
<dir>
<file>testfile1</file>
</dir>
<dir>
<file>testfile2</file>
</dir>... (4 Replies)
hi,
i have a directory at /path/unix with the following files
1.txt
2.txt
3.txt
4.txt
I want to make another file called filenames.txt at a different location called /path/home. So, my output file would be
/path/home/filenames.txt with contents
/path/unix/1.txt... (1 Reply)
hi,
how can i take the file names from a directory and store only the filenames in the file.
suppose i have a directory which contains the following files and subdirectories.
$ ls -ltr
total 16
-rw-rw-r-- 1 adm etc 4 Aug 6 20:37 s1.txt
-rw-rw-r-- 1 adm etc 4 Aug 6 20:37 s2.txt... (11 Replies)
Discussion started by: Little
11 Replies
LEARN ABOUT DEBIAN
verilog::editfiles
EditFiles(3pm) User Contributed Perl Documentation EditFiles(3pm)NAME
Verilog::EditFiles - Split Verilog modules into separate files.
SYNOPSIS
See splitmodule command.
use Verilog::EditFiles;
my $split = Verilog::EditFiles->new
(outdir => "processed_rtl",
translate_synthesis => 0,
lint_header => undef,
celldefine => 1,
);
$split->read_and_split(glob("inbound_rtl/*.v"));
$split->write_files();
$split->edit_file(filename=>"foo", cb => sub { return $_[0]; });
DESCRIPTION
Verilog::EditFiles provides a easy way to split library Verilog files that contain multiple modules into many files with one module per
file.
FUNCTIONS
new (...)
Create a new Verilog::EditFiles object. Named parameters may be specified:
celldefine
If true, add "`celldefine" before every module statement.
lint_command
For the write_lint method, the name of the linter to use. Defaults to "vlint --brief".
lint_header
If defined, add the provided text before every module statement. Generally used to insert lint off pragmas.
outdir
Name of the directory to write the output modules to. Defaults to ".".
program
Name of the program to add to comments. Defaults to "Verilog::EditFiles".
timescale_header
If defined, add the provided text before every module statement. Generally set to the next needed to #include a timescale file.
Use with timescale_removal.
timescale_removal
If set, remove any `timescales.
translate_synthesis
If 1, replace any synopsys translate on/offs with "`ifdef SYNTHESIS" and "`endif"s. If set to a string, use that string instead of
"SYNTHESIS".
v_suffix
The suffix to add to convert a module name into a filename. Defaults to ".v".
verbose
If true, print what files are being read and written.
$self->read_and_split ([filenames])
Read from the specified filenames.
If there is no module statement in the file, assume it is a include file, and when write_files is called, place all of the file
contents into the output. If there is a module statement, when write_files is called place all following output into a file named
based on the module, with .v added.
$self->write_files()
Write all of the files created by read_and_split to the outdir.
$self->write_lint([filename=>...])
Create a shell script that will lint every file created by write_files. If a "filename" parameter is not provided, "0LINT.sh" will be
written in the default outdir.
$self->edit_file(filename=>..., cb=>sub{...})
Read a file, edit it with the provided callback, and save it if it has changed. The "filename" parameter is the filename to read. The
"write_filename" parameter is the filename to write, defaulting to the same name as the filename to read. The "cb" parameter is a
reference to a callback which takes the string of file contents and returns the string to write back. Often the callback will simply
perform a search and replace.
DISTRIBUTION
Verilog-Perl is part of the <http://www.veripool.org/> free Verilog EDA software tool suite. The latest version is available from CPAN and
from http://www.veripool.org/verilog-perl <http://www.veripool.org/verilog-perl>.
Copyright 2006-2012 by Wilson Snyder. This package is free software; you can redistribute it and/or modify it under the terms of either
the GNU Lesser General Public License Version 3 or the Perl Artistic License Version 2.0.
AUTHORS
Wilson Snyder <wsnyder@wsnyder.org>
SEE ALSO
Verilog-Perl
perl v5.14.2 2012-05-04 EditFiles(3pm)