Hi folks,
there are windows device names in the sixth column of a comma separated file. A example device name is:
\\.\Tape0
I don't get the all string in to a variable, because of the preceding backslash. The first backslash is just cut off and my attempts to manipulate the string afterward... (0 Replies)
hii,
i need a unix command which replaces all occurrences of a substring within a string with another substring.
My solution:
string="plalstalplal"
sub1="al"
sub2="mlkl"
echo sed 's/$s2/$s3/g' < s1 > p
i want to know how to read the variables s2 and s3..
thaks a lot
bye (1 Reply)
Hi there,
I'd like to replace STRING_ZERO in FILE_ZERO.txt with the value of VALUEi-th by using something like that:
VALUE1=1000
VALUE2=2000
VALUE3=3000
for((i=1;i<=3;i++));
do
sed "s/STRING_ZERO/$VALUE'$i'/" FILE_ZERO.txt >> FILE_NEW.txt;
done
but it doesn't work...
Any help... (9 Replies)
Using a small script, I automatically generated some text logs. The files ended being undownloadable, unopenable and undeletable. Upon further investigation, the files ended up looking like this:
log\r
log2\r
log3\r
I've tried a few different things, including double slashing before the... (6 Replies)
Hi,
Newbie here. I have a file that consists of data that I want to convert to a csv file. For example:
Jul 20 2008 1111 / visit home / BlackBerry8830/4.2.2 Profile/MIDP-2.0 Configuration/CLOC-1.1 VendorID/105
Jul 21 2008 22222 / add friend / BlackBerry8830/4.2.2 Profile/MIDP-2.0... (3 Replies)
I have following set of dirs:
/dir1/dir2/subdir1
file1
file2
/dir1/dir3/subdir1
file4
file5
/dir1/dir4/subdir1
file6
file7
All of these files have a common string in them say "STRING1", How can I... (3 Replies)
Help!
I'm trying this command but keep getting illegal syntax etc.
awk '{ sub(/00012345/,"000123456"); print}' >newfile
I don't understand. It works on one unix machine but not another! (4 Replies)
Dear all,
I have a file like below. I want to replace all the '.' in the 3rd column with 'NA'. I don't know how to do that. Anyone has an iead? Thanks a lot!
8 70003200 21.6206
9 70005700 17.5064
10 70002200 .
11 70005100 19.1001
17 70008000 16.1970
32 70012400 26.3465
33... (9 Replies)
Hi All,
I have a many folders in a directory under which there are many subdirectories containing text files containing the word "shyam" in them.I want all the files in all the directories containing "shyam to "ram" ??
sed "s/shyam/ram/g" does it ??But anyone can help me with the script ??
... (3 Replies)
Discussion started by: Pradeep_1990
3 Replies
LEARN ABOUT CENTOS
file::dosglob
File::DosGlob(3pm) Perl Programmers Reference Guide File::DosGlob(3pm)NAME
File::DosGlob - DOS like globbing and then some
SYNOPSIS
require 5.004;
# override CORE::glob in current package
use File::DosGlob 'glob';
# override CORE::glob in ALL packages (use with extreme caution!)
use File::DosGlob 'GLOBAL_glob';
@perlfiles = glob "..\pe?l/*.p?";
print <..\pe?l/*.p?>;
# from the command line (overrides only in main::)
> perl -MFile::DosGlob=glob -e "print <../pe*/*p?>"
DESCRIPTION
A module that implements DOS-like globbing with a few enhancements. It is largely compatible with perlglob.exe (the M$ setargv.obj
version) in all but one respect--it understands wildcards in directory components.
For example, "<..\l*b\file/*glob.p?"> will work as expected (in that it will find something like '..libFile/DosGlob.pm' alright). Note
that all path components are case-insensitive, and that backslashes and forward slashes are both accepted, and preserved. You may have to
double the backslashes if you are putting them in literally, due to double-quotish parsing of the pattern by perl.
Spaces in the argument delimit distinct patterns, so "glob('*.exe *.dll')" globs all filenames that end in ".exe" or ".dll". If you want
to put in literal spaces in the glob pattern, you can escape them with either double quotes, or backslashes. e.g. "glob('c:/"Program
Files"/*/*.dll')", or "glob('c:/Program Files/*/*.dll')". The argument is tokenized using "Text::ParseWords::parse_line()", so see
Text::ParseWords for details of the quoting rules used.
Extending it to csh patterns is left as an exercise to the reader.
EXPORTS (by request only)
glob()
BUGS
Should probably be built into the core, and needs to stop pandering to DOS habits. Needs a dose of optimizium too.
AUTHOR
Gurusamy Sarathy <gsar@activestate.com>
HISTORY
o Support for globally overriding glob() (GSAR 3-JUN-98)
o Scalar context, independent iterator context fixes (GSAR 15-SEP-97)
o A few dir-vs-file optimizations result in glob importation being 10 times faster than using perlglob.exe, and using perlglob.bat is
only twice as slow as perlglob.exe (GSAR 28-MAY-97)
o Several cleanups prompted by lack of compatible perlglob.exe under Borland (GSAR 27-MAY-97)
o Initial version (GSAR 20-FEB-97)
SEE ALSO
perl
perlglob.bat
Text::ParseWords
perl v5.16.3 2013-03-04 File::DosGlob(3pm)