Sponsored Content
Full Discussion: creating a file using Perl
Top Forums Shell Programming and Scripting creating a file using Perl Post 302201804 by chriss_58 on Tuesday 3rd of June 2008 07:35:14 AM
Old 06-03-2008
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!
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Creating loop for a script -Perl

Hi Guyz I designed a script that can compare 2 columns(values) of single file and gives the closest numbers to the first column by comparing the numbers in first column with second and it works in a single file. Now I'm trying to design a new script with 2 objectives for 2 files (not a single... (4 Replies)
Discussion started by: repinementer
4 Replies

2. Shell Programming and Scripting

creating packages in perl

How to create Module Packages from the scratch in perl. Thanks in advance. (2 Replies)
Discussion started by: hansini
2 Replies

3. Shell Programming and Scripting

Creating output file using Perl

As an simple example, I have the following files fin1.zv being a one column set of number 1 90 2 80 3 60 4 30 5 20 fin2.zv is another file like this 1 10 20 30 40 50 2 60 70 80 90 0 3 90 80 70 60 50 4 40 30 20 10 0 5 10 20 30 40 50 (2 Replies)
Discussion started by: kristinu
2 Replies

4. Shell Programming and Scripting

Creating a date (without time) in perl

I have a perl script that automatically runs on Mondays. I need to have it create a variable for last Monday's date thru that Sunday's date. example: 04-01-2011 thru 04-08-2011 Its reporting numbers for the previous week beginning with Monday and ending on Sunday. So i dont have to go in... (7 Replies)
Discussion started by: bbraml
7 Replies

5. Shell Programming and Scripting

Help with creating a text file in perl with file creation date.

Hi, I am quite new to Perl scripting and i need to create a .TXT file using perl, with fields (A,B,C,D,E), and this text file should be named with current file creation date "XYZ_CCYYMMDD.TXT" (i.e.XYZ_2011042514:33 PM). Can anyone who has done this, please share their expertise on this... (5 Replies)
Discussion started by: msrahman
5 Replies

6. Shell Programming and Scripting

creating excel file using perl

Hi , I am writing a simple excel file and want to create the file under say 'D:\Documents and Settings'. The problem with my code is it is writing in the same directory instead of the specified. Here is a sample code use Spreadsheet::WriteExcel; my $workbook =... (1 Reply)
Discussion started by: daptal
1 Replies

7. Shell Programming and Scripting

creating color palette using awk or perl

Hi, I'm wondering if anyone have tried creating a color palette or table using awk or perl using a range of values. thanks for any suggestion in advance. 0-0.1: purple 0.1-0.2: blue 0.2-0.3: green 0.3-0.4: yellow 0.4-0.5: orange > 0.5: red Happy holidays,:) (5 Replies)
Discussion started by: ida1215
5 Replies

8. Shell Programming and Scripting

Perl- creating a matrix from a 3 column file

Dear all, I'm new in perl scripting and I'm trying to creating a matrix from a 3 column file sorting data in a particular manner. In the final matrix I need to have the first column "IDs" on the header of the columns and the second column values on the header of each row. And the value fo the... (2 Replies)
Discussion started by: gabrysfe
2 Replies

9. Shell Programming and Scripting

Splitting a file and creating new files using Perl script

Hi All, I am new to Scripting language. I want to split a file and create several subfiles using Perl script. Example : File format : Sourcename ID Date Nbr SU IMYFDJ 9/17/2012 5552159976555 SU BWZMIG 9/14/2012 1952257857887 AR PEHQDF 11/26/2012 ... (13 Replies)
Discussion started by: Deepak9870
13 Replies

10. Programming

Perl: restrict perl from automaticaly creating a hash branches on check

My issue is that the perl script (as I have done it so far) created empty branches when I try to check some branches on existence. I am using multydimentional hashes: found it as the best way for information that I need to handle. Saing multidimentional I means hash of hashes ... So, I have ... (2 Replies)
Discussion started by: alex_5161
2 Replies
SHOREWALL6-EXCLUSIO(5)						  [FIXME: manual]					    SHOREWALL6-EXCLUSIO(5)

NAME
exclusion - Exclude a set of hosts from a definition in a shorewall6 configuration file. SYNOPSIS
!address-or-range[,address-or-range]... !zone-name[,zone-name]... DESCRIPTION
Exclusion is used when you wish to exclude one or more addresses from a definition. An exclaimation point is followed by a comma-separated list of addresses. The addresses may be single host addresses (e.g., fe80::2a0:ccff:fedb:31c4) or they may be network addresses in CIDR format (e.g., fe80::2a0:ccff:fedb:31c4/64). If your kernel and ip6tables include iprange support, you may also specify ranges of ip addresses of the form lowaddress-highaddress No embedded whitespace is allowed. Exclusion can appear after a list of addresses and/or address ranges. In that case, the final list of address is formed by taking the first list and then removing the addresses defined in the exclusion. Beginning in Shorewall 4.4.13, the second form of exclusion is allowed after all and any in the SOURCE and DEST columns of /etc/shorewall/rules. It allows you to omit arbitrary zones from the list generated by those key words. Warning If you omit a sub-zone and there is an explicit or explicit CONTINUE policy, a connection to/from that zone can still be matched by the rule generated for a parent zone. For example: /etc/shorewall6/zones: #ZONE TYPE z1 ip z2:z1 ip ... /etc/shorewall6/policy: #SOURCE DEST POLICY z1 net CONTINUE z2 net REJECT /etc/shorewall6/rules: #ACTION SOURCE DEST PROTO DEST # PORT(S) ACCEPT all!z2 net tcp 22 In this case, SSH connections from z2 to net will be accepted by the generated z1 to net ACCEPT rule. FILES
/etc/shorewall6/hosts /etc/shorewall6/masq /etc/shorewall6/rules /etc/shorewall6/tcrules SEE ALSO
shorewall6(8), shorewall6-accounting(5), shorewall6-actions(5), shorewall6-blacklist(5), shorewall6-hosts(5), shorewall6-interfaces(5), shorewall6-maclist(5), shoewall6-netmap(5),shorewall6-params(5), shorewall6-policy(5), shorewall6-providers(5), shorewall6-rtrules(5), shorewall6-routestopped(5), shorewall6-rules(5), shorewall6.conf(5), shorewall6-secmarks(5), shorewall6-tcclasses(5), shorewall6-tcdevices(5), shorewall6-tcrules(5), shorewall6-tos(5), shorewall6-tunnels(5), shorewall-zones(5) [FIXME: source] 06/28/2012 SHOREWALL6-EXCLUSIO(5)
All times are GMT -4. The time now is 08:21 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy