![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| shift not working | Nagapandi | UNIX for Dummies Questions & Answers | 4 | 06-11-2008 04:28 AM |
| shift and push question in perl | hankooknara | Shell Programming and Scripting | 5 | 06-29-2007 06:37 AM |
| Regarding the shift command??? | shrao | Shell Programming and Scripting | 2 | 03-31-2007 03:39 AM |
| shift command | Nisha | Shell Programming and Scripting | 6 | 07-19-2002 05:54 AM |
| shift command | AkumaTay | UNIX for Dummies Questions & Answers | 1 | 05-20-2002 08:26 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
I dont know if I should start a new thread for this as it is contained within the same code that I'm working on in this thread but anyway I have another question
I'm trying to make a series of directories with the newly created names that I have generated...here is the loop that I have, and it doesn't seem to be working: } open(FOLDER, "temp.txt"); while ($test = <FOLDER>) { #print $test; mkdir('$test',0777) || print $!; } For some reason this code keeps generating code with ints instead of the actual chars contained within the file, perhaps its trying to count each line? I'm still very hazy on how to read files into vars line by line. Can anyone enlighten me>? |
|
||||
|
amend below %hash accordingly should help you some.
Code:
%hash=(Jan,"01",Jul,"07",UC,"Union City");
open FH,"<a.txt";
while(<FH>){
@arr=split("-",$_);
$arr[0]= ($hash{$arr[0]})?$hash{$arr[0]}:ucfirst($arr[0]);
$arr[2]= $hash{substr($arr[2],0,3)};
print join "-",@arr;
}
|
| Sponsored Links | ||
|
|
![]() |
| Bookmarks |
| Tags |
| perl, perl shift, scripting, shift, shift perl |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|