Hi all,
Am new to scripting. So i just need your ideas to help me out. Here goes my requirement.
I have two csv files
1.csv 2.csv
abc,1.24 abc,1
def,2.13 def,1
I need to compare the first column of 1.csv with 2.csv and if matches then need to compare... (2 Replies)
I have been trying to find a good solution for this seemingly simple task for 2 days, and I'm giving up and posting a thread. I hope someone can help me out!
I'm on HPUX, using sqlplus, mailx, awk, have some other tools available, but can't install stuff that isn't already in place (without a... (6 Replies)
Hi Fellows,
I have been struggling to fix an issue in csv records to compose sql statements and have been really losing sleep over it. Here is the problem:
I have csv files in the following pipe-delimited format:
Column1|Column2|Column3|Column4|NEWLINE
Address Type|some descriptive... (4 Replies)
Hi
I have two csv files, with the following formats:
FileA.log:
Application, This occured blah
Application, That occured blah
Application, Also this
AnotherLog, Bob did this
AnotherLog, Dave did that
FileB.log:
Uk, London, Application, datetime, LaterDateTime, Today it had'nt... (8 Replies)
hi, someone to know how can i read a specific column of csv file and search the value in other csv columns if exist the value in the second csv copy entire row with all field in a new csv file. i suppose that its possible using awk but i m not expertise thanks in advance (8 Replies)
Hi,
I am tryng to read from a csv file and based on some grep command output I will modify one of the column in the same csv.
Example:-
Input CSV:-
20120829001415,noneAA,google.com
20120829001415,dfsafds,google.com
20120829001415,noneAA,google.com
Intermediate Step:- If 2nd column of... (3 Replies)
Hi all,
I have a csv file that appears as follows:
,2013/03/26,2012/12/26,4,1,"2017/09/26,5.75%","2017/09/26,1,2018/09/26,1,2019/09/26,1,2020/09/26,1,2021/09/26,1",,,2012/12/26,now when i use the split function like this:
my @f = split/,/; the split function will split the data that is... (2 Replies)
Hi,
I have a file of csv data, which looks like this:
file1:
1AA,LGV_PONCEY_LES_ATHEE,1,\N,1,00020460E1,0,\N,\N,\N,\N,2,00.22335321,0.00466628
2BB,LES_POUGES_ASF,\N,200,200,00006298G1,0,\N,\N,\N,\N,1,00.30887539,0.00050312... (10 Replies)
Discussion started by: djoseph
10 Replies
LEARN ABOUT DEBIAN
tm::serializable::csv
TM::Serializable::CSV(3pm) User Contributed Perl Documentation TM::Serializable::CSV(3pm)NAME
TM::Serializable::CSV - Topic Maps, trait for parsing (and later dumping) CSV stream
SYNOPSIS
# 1) bare bones
my $tm = .....; # get a map from somewhere (can be empty)
Class::Trait->apply ($tm, "TM::Serializable::CSV");
use Perl6::Slurp;
$tm->deserialize (slurp 'myugly.csv');
# 2) exploiting the timed sync in/out mechanism
my $tm = new TM::.... (url => 'file:myugly.csv'); # get a RESOURCEABLE map from somewhere
$tm->sync_in;
DESCRIPTION
This trait provides parsing and dumping from CSV formatted text streams.
INTERFACE
Methods
deserialize
$tm->deserialize ($text)
This method consumes the text string passed in and interprets it as CSV formatted information. What topic map information is generated,
depends on the header line (the first line):
o If the header line contains a field called "association-type", then all rows will be interpreted as assertions. In that the
remaining header fields (in that order) are interpreted as roles (role types). For all rows in the CSV stream, the position where
the "association-type" field was is ignored. The other fields (in that order) are affiliated with the corresponding roles.
Example:
association-type,location,bio-unit
is-born,gold-coast,rumsti
is-born,vienna,ramsti
Scoping cannot be controlled. Also all players and roles (obviously) are directly interpreted as identifiers. Subject identifiers
and locators are not (yet) implemented.
o If the header line contains a field called "id", then all further rows will be interpreted as topic characteristics, with each
topic on one line. The column position where the "id" field in the header is will be interpreted as toplet identifier.
All further columns will be interpreted according to the following:
o If the header column is named "name", the values will be used as topic names.
o Otherwise if the value looks like a URI, an occurrence with that URI value will be be added to the topic.
o Otherwise an occurrence with a string value will be added to the topic.
Example:
name,id,location,homepage
"Rumsti",rumsti,gold-coast,http://rumsti.com
"Ramsti",ramsti,vienna,http://ramsti.com
serialize
$tm->serialize
[Since TM 1.53] This method serializes a fragment of a topic map into CSV. Which fragment can be controlled with the header line and
options (see constructor).
"header_line" (only for serialization)
This string contains a comma separated list (CSV parseable) of headings. If one of the headings is "association-type", then the
generated CSV content will contain associations only. Nothing else is implemented yet. The other headings control which roles (and
in which order) should be included in the CSV content. If a particular role type has more than one player, then all players are
included.
NOTE: As this is inconsistent, this will have to change.
"type" (only for serialization)
If existing, then this controls which association type is to be taken.
"baseuri" (only for serialization)
If existing and non-zero, the base URI of the map will remain in the identifiers. Otherwise it will be removed.
"specification"
If existing (and when selecting only associations), this specification will be interpreted in the sense of "asserts" (see TM).
Example:
$tm->serialize (header_line => 'association-type,location,bio-unit',
type => 'is-born',
baseuri => 0);
SEE ALSO
TM, TM::Serializable
AUTHOR INFORMATION
Copyright 2010 Robert Barta.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
http://www.perl.com/perl/misc/Artistic.html
perl v5.10.1 2012-06-05 TM::Serializable::CSV(3pm)