![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | 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 here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| perl -write values in a file to @array in perl | meghana | Shell Programming and Scripting | 12 | 07-17-2008 01:38 PM |
| Creating a file | ravisg | Shell Programming and Scripting | 2 | 05-10-2008 03:15 AM |
| help with creating new log file | john89011 | Shell Programming and Scripting | 0 | 02-29-2008 09:45 AM |
| Creating a txt file | outthere_3 | UNIX for Dummies Questions & Answers | 1 | 01-31-2008 08:09 PM |
| Creating a csv file based on Existing file | skywayterrace | Shell Programming and Scripting | 3 | 12-02-2007 06:19 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
#1
|
|||
|
|||
|
creating a file using Perl
Hi guys,
when i use the following code: open(DEST, ">>DESTINATION_")|| die "$!"; #OPEN FILE FOR WRITING @contents=@field; print DEST "@contents\n"; I am creating a file that lookss like this: Wed May 14 11:42:03 2008 10800 306973223399 19419-NEA 1 1259 1 3 80 What i want to do is to create a file that looks like the line below: Wed May 14 11:42:03 2008| 10800| 306973223399| 19419-NEA| 1 | 1259| 1| 3| 80 This means that every field in the @contents must be seperated by its neighboor with a "|" Any idea how am i going to implement this? Thank you very much! |
| Forum Sponsor | ||
|
|
|
#2
|
|||
|
|||
|
Code:
print DEST (join ("|", @contents), "\n");
|
|||
| Google The UNIX and Linux Forums |