Sponsored Content
Full Discussion: How to parse csv format?
Top Forums Shell Programming and Scripting How to parse csv format? Post 302435697 by pravin27 on Thursday 8th of July 2010 04:13:15 AM
Old 07-08-2010
Hi,
you have install the attached module.
1) Save this tar file in /tmp/Text-CSV-1.18.tar
2) Untar the file.
3) INSTALLATION
Go to the directory "/tmp/Text-CSV-1.18"
To install this module type the following:

perl Makefile.PL
make
make test
make install
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

How to Parse a CSV file into a Different Format

Hi I have a CSV file with me in this format Currency, USD, EUR, USD, 1.00, 1.32, EUR, 0.66, 1.00, How do I transpose the file to get to the format below. currency, currency, rate USD, USD, 1.00 USD, EUR, 1.32 EUR, USD, 0.66 EUR, EUR, 1.00 Thanks for your help We are using... (2 Replies)
Discussion started by: cdesiks
2 Replies

2. Shell Programming and Scripting

CSV File parse help in Perl

Folks, I have a bit of an issue trying to obtain some data from a csv file using PERL. I can sort the file and remove any duplicates leaving only 4 or 5 rows containing data. My problem is that the data contained in the original file contains a lot more columns and when I try ro run this script... (13 Replies)
Discussion started by: lodey
13 Replies

3. Shell Programming and Scripting

Unix Script to parse a CSV

I am writing a unix script that will parse a CSV and edit the values. My CSV looks like this 0,0,0,0,1,0,1,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0 10,11,7,0,4,12,2,3,7,0,11,3,12,4,0,5,5,4,5,0,8,6,12,0,9,3,3,0,2,7,8... (16 Replies)
Discussion started by: RJ17
16 Replies

4. Shell Programming and Scripting

Parse XML file into CSV with shell?

Hi, It's been a few years since college when I did stuff like this all the time. Can someone help me figure out how to best tackle this problem? I need to parse a file full of entries that look like this: <eq action="A" sectyType="0" symbol="PGR" exch="CA" curr="VEF" sess="NORM"... (7 Replies)
Discussion started by: Pcushing
7 Replies

5. Shell Programming and Scripting

Parse csv file

Hi, Our requirement is to parse the input file(.csv format). The each column in the file is delimited with comma. We need to take each column and apply some business validation rule. If data itself contains comma, then those fields are enclosed with double quotes ("). We can see this double... (7 Replies)
Discussion started by: vfrg
7 Replies

6. Shell Programming and Scripting

Retaining the Unix CSV format in Excel format while exporting

Hi All, I have created a Unix Shell script whch creates a *.csv file and export it to Excel. The problem i am facing is that Users wants one of the AMOUNT field in comma separted values. Example : if the Amount has the value as 3000000 User wants to be in 3,000,000 format. This Amount format... (2 Replies)
Discussion started by: rawat_me01
2 Replies

7. Shell Programming and Scripting

how to parse this file and obtain a .csv or .xls

Hello Expert, I have a file in the following format: SYNTAX_VERSION 5 MONITOR "NAME_TEMPLATES" DESCRIPTION "Monitors for contents of error " INTERVAL "1m" MONPROG "script.sh NAME_TEMPLATES" MAXTHRESHOLD GEN_BELOW_RESET SEVERITY Major ... (17 Replies)
Discussion started by: Ant-one
17 Replies

8. Shell Programming and Scripting

Parse csv files by their names

HI all I have multiple csv files with the names VAR1_VAR2_VAR3_VAR4.csv All the files have the same structure inside just values change. I am trying to retrieve data from those files by fixing at each time one or more VAR. I tried to write a script but I have 2 problems: 2-... (1 Reply)
Discussion started by: Jhon.c
1 Replies

9. Shell Programming and Scripting

How to parse this file using awk and output in CSV format?

My source file looks like this: Cust-Number = "101" Cust-Name="Joe" Cust-Town="London" Cust-hobby="tennis" Cust-purchase="200" Cust-Number = "102" Cust-Name="Mary" Cust-Town="Newyork" Cust-hobby="reading" Cust-purchase="125" Now I want to parse this file (leaving out hobby) and... (10 Replies)
Discussion started by: Balav
10 Replies

10. Shell Programming and Scripting

Need a script to parse data and output to csv

I am not too savvy with arrays and am assuming that what I am looking for needs arrays. This is my requirement. So I have the raw data that gets updated to a log as shown below StudentInfo: FullInfo = { Address = Newark Age = 20 Name= John } StudentInfo:... (2 Replies)
Discussion started by: sidnow
2 Replies
CPANPLUS::Dist::MM(3pm) 				 Perl Programmers Reference Guide				   CPANPLUS::Dist::MM(3pm)

NAME
CPANPLUS::Dist::MM SYNOPSIS
$mm = CPANPLUS::Dist::MM->new( module => $modobj ); $mm->create; # runs make && make test $mm->install; # runs make install DESCRIPTION
"CPANPLUS::Dist::MM" is a distribution class for MakeMaker related modules. Using this package, you can create, install and uninstall perl modules. It inherits from "CPANPLUS::Dist". ACCESSORS
parent() Returns the "CPANPLUS::Module" object that parented this object. status() Returns the "Object::Accessor" object that keeps the status for this module. STATUS ACCESSORS
All accessors can be accessed as follows: $mm->status->ACCESSOR makefile () Location of the Makefile (or Build file). Set to 0 explicitly if something went wrong. make () BOOL indicating if the "make" (or "Build") command was successful. test () BOOL indicating if the "make test" (or "Build test") command was successful. prepared () BOOL indicating if the "prepare" call exited succesfully This gets set after "perl Makefile.PL" distdir () Full path to the directory in which the "prepare" call took place, set after a call to "prepare". created () BOOL indicating if the "create" call exited succesfully. This gets set after "make" and "make test". installed () BOOL indicating if the module was installed. This gets set after "make install" (or "Build install") exits successfully. uninstalled () BOOL indicating if the module was uninstalled properly. _create_args () Storage of the arguments passed to "create" for this object. Used for recursive calls when satisfying prerequisites. _install_args () Storage of the arguments passed to "install" for this object. Used for recursive calls when satisfying prerequisites. METHODS
$bool = $dist->format_available(); Returns a boolean indicating whether or not you can use this package to create and install modules in your environment. Sets up the "CPANPLUS::Dist::MM" object for use. Effectively creates all the needed status accessors. Called automatically whenever you create a new "CPANPLUS::Dist" object. "prepare" preps a distribution for installation. This means it will run "perl Makefile.PL" and determine what prerequisites this distribution declared. If you set "force" to true, it will go over all the stages of the "prepare" process again, ignoring any previously cached results. When running "perl Makefile.PL", the environment variable "PERL5_CPANPLUS_IS_EXECUTING" will be set to the full path of the "Makefile.PL" that is being executed. This enables any code inside the "Makefile.PL" to know that it is being installed via CPANPLUS. Returns true on success and false on failure. You may then call "$dist->create" on the object to create the installable files. $href = $dist->_find_prereqs( file => '/path/to/Makefile', [verbose => BOOL]) Parses a "Makefile" for "PREREQ_PM" entries and distills from that any prerequisites mentioned in the "Makefile" Returns a hash with module-version pairs on success and false on failure. $bool = $dist->create([perl => '/path/to/perl', make => '/path/to/make', makeflags => 'EXTRA=FLAGS', prereq_target => TARGET, skiptest => BOOL, force => BOOL, verbose => BOOL]) "create" creates the files necessary for installation. This means it will run "make" and "make test". This will also scan for and attempt to satisfy any prerequisites the module may have. If you set "skiptest" to true, it will skip the "make test" stage. If you set "force" to true, it will go over all the stages of the "make" process again, ignoring any previously cached results. It will also ignore a bad return value from "make test" and still allow the operation to return true. Returns true on success and false on failure. You may then call "$dist->install" on the object to actually install it. $bool = $dist->install([make => '/path/to/make', makemakerflags => 'EXTRA=FLAGS', force => BOOL, verbose => BOOL]) "install" runs the following command: make install Returns true on success, false on failure. $bool = $dist->write_makefile_pl([force => BOOL, verbose => BOOL]) This routine can write a "Makefile.PL" from the information in a module object. It is used to write a "Makefile.PL" when the original author forgot it (!!). Returns 1 on success and false on failure. The file gets written to the directory the module's been extracted to. perl v5.12.1 2010-04-26 CPANPLUS::Dist::MM(3pm)
All times are GMT -4. The time now is 06:07 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy