write a perl script or kornshell reading a two files and outputting to comma format


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting write a perl script or kornshell reading a two files and outputting to comma format
# 1  
Old 09-13-2009
write a perl script or kornshell reading a two files and outputting to comma format

Hello
Can someone help me to write a perl script or kornshell reading a two files and outputting to comma format.

Here is the two files
listofdisks.txt
id, diskname, diskgroup, diskisze(GB), FC
1, CN34, GRP1, 30, FC_CN34
2, CN67, GRP5, 19,
4, VD1, GRP4, 23, FC_VD1
6, CF_D1, GRP10, 23,
10, CN1, GRP4, 20, FC_CN1
11, vcD1, GRP1, 5,

second file
listofhostmappedtodisks.txt
hostname, diskname
CN12A, CN34
CN3C, VD1
CN12B, CN34
CL2, CN67
CN3A, VD1
CN3B, VD1
DF1, CF_D1
F1, CN1

The out should look like this:
OUTPUT
id, diskname hostname diskgroup diskisze(GB) FC
1, CN34, CN12A/CN12B GRP1, 30, FC_CN34
2, CN67, CL2, GRP5, 19,
4, VD1, CN3C/CN3A/CN3B, GRP4, 23, FC_VD1
6, CF_D1, DF1, GRP10, 23,
10, CN1, F1, GRP4, 20, FC_CN1
11, vcD1, GRP1, 5,

Thanks for your help in advance
Deiow
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

How to write in multiple output files in perl?

hi, Hope you are doing good. During my coding yesterday i got this challenge, actually not a challenge it like to optimize the code. I am printing some statement to monitor the file progress in the log file an also to display it in the screen. so i ended up in the below statements. ... (6 Replies)
Discussion started by: mad man
6 Replies

2. Programming

Date format change from mm/dd/yyyy to yyyymmdd in comma seperate line in perl

Hi All, I have line ,A,FDRM0002,12/21/2017,,0.961751583,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, it contains date in mm/dd/yyyy format i want to change this to yyyymmdd format using perl. Use code tags, thanks. (8 Replies)
Discussion started by: vishal0746
8 Replies

3. Shell Programming and Scripting

Need script for transferring bulk files from one format to text format

"Help Me" Need script for transferring bulk files from one format to text format in a unix server. Please suggest (2 Replies)
Discussion started by: Kranthi Kumar
2 Replies

4. Shell Programming and Scripting

Perl Script for reading table format data from file.

Hi, i need a perl script which reads the file, content is given below. and output in new file. TARGET DRIVE IO1 IO2 IO3 IO4 IO5 ------------ --------- --------- --------- --------- --------- 0a.1.8 266 236 ... (3 Replies)
Discussion started by: asak
3 Replies

5. Homework & Coursework Questions

Shell script calling Perl function, sort and find data, write to new files

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: I must write a shell script that calls two external Perl functions--one of which sorts the data in a file, and... (6 Replies)
Discussion started by: kowit010
6 Replies

6. Shell Programming and Scripting

Perl script to parse output and print it comma separated

I need to arrange output of SQL query into a comma separated format and I'm struggling with processing the output... The output is something like this: <Attribute1 name><x amount of white spaces><Atribute value> <Attribute2 name><x amount of white spaces><Atribute value> <Attribute3... (2 Replies)
Discussion started by: Juha
2 Replies

7. Shell Programming and Scripting

Perl Script Not Reading Input Files Correctly

This is one of the strangest things that's happening to me. I'm writing a new Perl script that is trying to read a file. The file is originally in .mof format, but I also saved the contents into a .txt file. As a simple test, I wrote this: #!/user/bin/perl -w use strict; ... (3 Replies)
Discussion started by: kooshi
3 Replies

8. Shell Programming and Scripting

Reading comma separated variable into other variables in shell script

Hi, In shell script, I have a variable var = xyz, inn, day, night, calif ....n and I would like to read them in to var1 = xzy, var2 = inn, var3= day, var4 = night....var. probably in a loop. I would like to read the variables until end of the line. Comma is the delimiter and there's no comma at... (3 Replies)
Discussion started by: suryaemlinux
3 Replies

9. Shell Programming and Scripting

How to write shell script for input file name format checking?

Hello, I had written a shell script that accepts input file as cmd line argument and process this file. if ; then if ; then . $1 LOGFILE="$LOG_FILE/MIG_BIOS.log"; get_input_file else ERROR_CODE=MSCRM0005_003 error "$ERROR_CODE : Input file $1 is not available"; exit... (3 Replies)
Discussion started by: Poonamol
3 Replies

10. Shell Programming and Scripting

how to write script in compress format

i have the script how to write script in compress format in tar (1 Reply)
Discussion started by: naveeng.81
1 Replies
Login or Register to Ask a Question
GENCFU(1)							 ICU 50.1.2 Manual							 GENCFU(1)

NAME
gencfu - Generates Unicode Confusable data files SYNOPSIS
gencfu [ -h, -?, --help ] [ -V, --version ] [ -c, --copyright ] [ -v, --verbose ] [ -d, --destdir destination ] [ -i, --icudatadir direc- tory ] -r, --rules rule-file -w, --wsrules whole-script-rule-file -o, --out output-file DESCRIPTION
gencfu reads confusable character definitions in the input file, which are plain text files containing confusable character definitions in the input format defined by Unicode UAX39 for the files confusables.txt and confusablesWholeScript.txt. This source (.txt) format is also accepted by ICU spoof detectors. The files must be encoded in utf-8 format, with or without a BOM. Normally the output data file has the .cfu extension. OPTIONS
-h, -?, --help Print help about usage and exit. -V, --version Print the version of gencfu and exit. -c, --copyright Embeds the standard ICU copyright into the output-file. -v, --verbose Display extra informative messages during execution. -d, --destdir destination Set the destination directory of the output-file to destination. -i, --icudatadir directory Look for any necessary ICU data files in directory. For example, the file pnames.icu must be located when ICU's data is not built as a shared library. The default ICU data directory is specified by the environment variable ICU_DATA. Most configurations of ICU do not require this argument. -r, --rules rule-file The source file to read. -w, --wsrules whole-script-rule-file The whole script source file to read. -o, --out output-file The output data file to write. VERSION
1.0 COPYRIGHT
Copyright (C) 2009 International Business Machines Corporation and others ICU MANPAGE
24 May 2009 GENCFU(1)