Search Results

Search: Posts Made By: birei
7,039
Posted By birei
Hi MIA651, One way using perl. It prints the...
Hi MIA651,

One way using perl. It prints the file name, a colon and the number of characters in last line:
$ perl -lne 'if ( eof ) { printf qq|%s: %d\n|, $ARGV, length; }' *
3.txt: 12
AAAB.txt:...
1,913
Posted By birei
Try following solution. Now the script accepts...
Try following solution. Now the script accepts two arguments. The first one is a file with a number per line, and the second one is the xml file:

$ cat infile
98
12
$ cat script.pl...
2,251
Posted By birei
Hi Mr.Smith, One way: $ cat infile ...
Hi Mr.Smith,

One way:

$ cat infile
/mediawiki-1.19.0/index.php/RickJames !!add new line here!!
/mediawiki-1.19.0/index.php/Sabaton
some url
$ perl -pe 's{\A(\Q/mediawiki-1.19.0\E)}{\n$1}'...
1,913
Posted By birei
A solution to your problem using perl and the...
A solution to your problem using perl and the module XML::Twig:

$ cat infile
<root>
<Text Id="98">
<Language id="1">Su saldo es $mainAccountBalance1Tiene ademas...
1,913
Posted By birei
Hi Ashu_099, 1.- Replace? with what? 2.-...
Hi Ashu_099,

1.- Replace? with what?
2.- That xml file is not well formed.
3.- Show sample output to get more helpful answers.
1,201
Posted By birei
eq is for comparing strings. To check regular...
eq is for comparing strings. To check regular expression use =~ without double quotes:

if ($ARGV[0] =~ m/^-(\d+)$/) { print "I think it works\n"; }
143,684
Posted By birei
Hi huaihaizi3, Pretty. I've been playing...
Hi huaihaizi3,

Pretty. I've been playing some minutes and it's difficult, there are some strange pieces that are very tricky to fit :)

I will take a look to the source code to learn some bash...
3,218
Posted By birei
Hi MaindotC, You have a mix between the...
Hi MaindotC,

You have a mix between the selection command /.../ and substitute command s/.../.../

Use:

/^$/ d
1,188
Posted By birei
Hi R3353, One way using perl: $ cat...
Hi R3353,

One way using perl:

$ cat script.pl
use warnings;
use strict;

my (%hash);

while ( <> ) {

chomp;

my @f = split /,/;

if ( $f[0] eq $f[1] ) {
...
1,148
Posted By birei
First, does that option fit your needs? ...
First, does that option fit your needs?

Second, in a GUI version of Vim you can move the bar between both windows with your mouse. For a short command, add it to your vimrc file or use a mapping...
2,553
Posted By birei
First point works for me, and to search without...
First point works for me, and to search without going deep into subdirectories add option -maxdepth 1
2,553
Posted By birei
Hi dll_fpga, Does this work for you? $...
Hi dll_fpga,

Does this work for you?

$ find . -type f | vim -
4,120
Posted By birei
Hi RobP, One way using perl: $ cat...
Hi RobP,

One way using perl:

$ cat infile
/*------XXXXXX-------*/

owner: XXXX
location: XXXX
Comment: XXXX
Phone: XXXX

/*------XXXXXX-------*/

owner: XXXX
location: XXXX
Desc:...
4,311
Posted By birei
Hi Lina_14, In read file1 and cat $file...
Hi Lina_14,

In read file1 and cat $file variables are different and program seems to hang because cat waits for input from keyboard. I had to remove it and the sixth option (6.Delete file) worked.
6,321
Posted By birei
Hi Vryali, Try this way. Substitute tail -f...
Hi Vryali,

Try this way. Substitute tail -f $ARGV[1] with your TSM command and the script will write output to first parameter file in command line with date inserted at the beginning of each...
1,240
Posted By birei
Hi A-V, One way using perl: $ cat...
Hi A-V,

One way using perl:

$ cat infile
This is a book
The book is on the shelf and the pen is on the table
$ cat script.pl
use strict;
use warnings;

my %word = map { $_ => 1 } qw/the...
1,946
Posted By birei
For also positive numbers use: $ sed -e...
For also positive numbers use:

$ sed -e 's/^[^-0-9].*$/>>/' infile
1,946
Posted By birei
Hi Gery, Try with: $ cat infile ...
Hi Gery,

Try with:

$ cat infile
geometry,geometry_vertex_count,Id,strnum,platecode,datatype,dtnum,refnum,appearance,disappeara,color,geogdesc,datatype_ft_style,import_notes...
5,359
Posted By birei
Hi yifangt, One more way using perl: $...
Hi yifangt,

One more way using perl:

$ cat infile
>head1
ACGATAGCTCTAGCTAGCTA
>header2
GGCGCTATGGCGACTGATCAGC
CCGAAAGATGCT
>other header name
>some thing maybe long but single line for...
1,052
Posted By birei
Yes. See Regexp Quote-Like Operators in perlop. ...
Yes. See Regexp Quote-Like Operators in perlop.

The substitution command replaces first part with second part s/first_part/second_part/. The 'g' flag is to apply the substitution many times for...
2,268
Posted By birei
Hi srivignesh.kn, One way: $ wc -l...
Hi srivignesh.kn,

One way:

$ wc -l *.ksh | sed -e '$d; s/[ ]/,/'
16,espress_raise.ksh
173,espresso_monitoring.ksh
1,696
Posted By birei
Hi kmsekhar, One way: $ cat infile A...
Hi kmsekhar,

One way:

$ cat infile
A
JACK WAS_${HH}_JACK ....
$ awk 'FNR == 1 { temp = $1; next } FNR == 2 { sub( /\${HH}/, temp ) } { print }' infile
JACK WAS_A_JACK ....
3,726
Posted By birei
Hi imtiaz99, Try with perl. It's a great...
Hi imtiaz99,

Try with perl. It's a great tool for this kind of tasks:

$ cat infile
11686 19151 25489 45012
11686 19151 3257 29286 3209|6774|8928|20459|37185
11686 19151 39792 21367 38922...
2,933
Posted By birei
Hi sven44, One way with perl: $ cat...
Hi sven44,

One way with perl:

$ cat infile ...
1,849
Posted By birei
Hi newpro, One way: $ cat file1 X1 ...
Hi newpro,

One way:

$ cat file1
X1
X3
X4
$ cat file2
ID X1 X2 X3 X4
A 1 6 2 1
B 2 7 3 3
C 3 8 4 ...
Showing results 1 to 25 of 168

 
All times are GMT -4. The time now is 10:25 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy