10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Experts - Any advice on how to get a hash value in a foreach loop?
Values print correctly on standalone print statements, but I can't access value
in foreach loop.
See sample code below and thanks in advance.
foreach my $z (sort keys %hash) {
for $y (@{$hash{$z}}) {
print "$z... (6 Replies)
Discussion started by: timj123
6 Replies
2. UNIX for Advanced & Expert Users
Hi Folks :)
I have a .txt file with thousands of words. I'm trying to sort the lines in order based on number of words per line.
Example
from:
word
word word word
word word
word word word word
word
word word word
word word
to desired output:
word (2 Replies)
Discussion started by: martinsmith
2 Replies
3. Shell Programming and Scripting
Hi,
I am quite new to perl scripting.
I have a dat file (datFile) from which I am pulling only first column and saving the output to a new file (f). From that file (f) I am removing blank lines and saving it to new file (datFile1). I am able to get the count of $f file in variable $cnt. But... (4 Replies)
Discussion started by: Neethu
4 Replies
4. Shell Programming and Scripting
Need perl or shell script to sort vertical lines to horizontal line in csv format
My file like below
-------------------------
================================================================================
PATH PINKY1000#I1-1-ZENTA1000-2#I7-1-ASON-SBR-UP-943113845 ... (4 Replies)
Discussion started by: sreedhargouda.h
4 Replies
5. Shell Programming and Scripting
My script is as below:
my $tile_list = `egrep "FCFP_TILE_LIST.*=" ${BudgetDir}/tile.params | sed -e 's/FCFP_TILE_LIST//' | sed -e 's/=//'`;
print "Tile List = ".$tile_list."\n";
my @tiles = split(/\s+/, $tile_list);
$unconst_out = "${DestDir}/Unconstrained_ports.rpt";
$check_tim_out =... (2 Replies)
Discussion started by: kuchi7
2 Replies
6. Shell Programming and Scripting
I want to sort lines by how many times a string occurs in each line (the most times first).
I know how to do this in two passes (add a count field in the first pass then sort on it in the second pass).
However, can it be done more optimally with a single AWK command? My AWK has improved... (11 Replies)
Discussion started by: Michael Stora
11 Replies
7. Programming
Hello All,
Im a Hardware engineer, I have written this script to automate my job. I got stuck in the following location.
CODE:
..
..
...
foreach $key(keys %arr_hash) {
my ($loc,$ind,$add) = split /,/, $arr_hash{$key};
&create_verilog($key, $loc, $ind ,$add);
}
sub create_verilog{... (2 Replies)
Discussion started by: riyasnr007
2 Replies
8. Shell Programming and Scripting
I have a simple csh script that has a simple foreach loop that goes over numbers, from 1 to 10:
foreach n(1 2 3 4 5 6 7 8 9 10)
...
end
Now I want to expand the script to work on over a hundred consecutive n values. Obviously, typing all the numbers between 1 to 100 is an unreasonable... (7 Replies)
Discussion started by: mcbenus
7 Replies
9. Shell Programming and Scripting
#!/usr/bin/perl
use Shell;
open THEFILE, "C:\galileo_integration.txt" || die "Couldnt open the file!";
@wholeThing = <THEFILE>;
close THEFILE;
foreach $line (@wholeThing){
if ($line =~ m/\\0$/){
@nextThing = $line;
if ($line =~ s/\\0/\\LATEST/g){
@otherThing =... (2 Replies)
Discussion started by: nmattam
2 Replies
10. Shell Programming and Scripting
I have two arrays
@nextArray contains some files like
\main\1\Xul.xml@@\main\galileo_integration_sjc\0
\main\1\PortToStorageDialog.xml@@\main\galileo_integration_sjc\0
.
.
.
\main\1\PreferencesDialog.xml@@\main\galileo_integration_sjc\0
@otherArray contains some files like
... (2 Replies)
Discussion started by: nmattam
2 Replies