I have a csv file which has three columns
mem no. name surname
1234 John Smith
12345 John Doe
I want to change the mem no. to add TF to the mem no. field i.e.
mem no. name surname
1234TF John Smith
12345TF John Doe
How do you do this for all records in the file? (3 Replies)
Hi, all
I need to get fields in a line that are separated by commas, some of the fields are enclosed with double quotes, and they are supposed to be treated as a single field even if there are commas inside the quotes.
sample input:
for this line, 5 fields are supposed to be extracted, they... (8 Replies)
Hi,
I have csv file with records as below. Now i have remove any comma in the filed value because that creates problem when i feed this file to an application.
for example below are two sample records, the second record have a comma in "Salesforce.com, Inc." field, now i have to remove this... (13 Replies)
Hello there,
I have a comma separated csv , and all the text field is wrapped by double quote. Issue is some text field contain comma as well inside double quote. so it is difficult to process.
Input in the csv file is ,
1,234,"abc,12,gh","GH234TY",34
I need output like below,... (8 Replies)
I am having two csv files i need to compare these files and the output file should have the information of the differences at the field level.
For Example,
File 1:
A,B,C,D,E,F
1,2,3,4,5,6
File 2:
A,C,B,D,E,F
1,2,4,5,5,6
out put file: (12 Replies)
Hi,
I have a CSV file of 40 columns with "," as delimiter. I want to assign the value of each column to a variable. But some of the columns content inside contains "," so how can i split the columns and assign it to a variable.
Regards,
ARASU. (1 Reply)
Awk gurus,
Greatly appreciate for any kind of assistance from the expert community
Input line:
abc,11.22.33.44,xyz,7-8-9-10
pqr,111.222.333.444,wxy,1-2-3
def,22.33.44.55,stu,7-8
used the gsub function below but it changes all of the "-" delimiter:
awk 'gsub("-",",")'
Desired... (4 Replies)
Hi Guys,
I have the file
---
HOST_NAME,data_coleta,data_carga,CPU_util,CPU_idle,run_queue,memory,MEMORY_SYSTEM,MEMORY_TOTAL,MEMORY_SWAPIN,MEMORY_SWAPOUT,DISK_READ,DISK_WRITE,DISK_IO,NET_IN_PACKET,
NET_OUT_PACKET... (4 Replies)
We have a csv file as mentioned below and the requirement is to change the date format in file as mentioned below.
Current file (file.csv)
----------------------
empname,date_of_join,dept,date_of_resignation
ram,08/09/2015,sales,21/06/2016
"akash,sahu",08/10/2015,IT,21/07/2016
... (6 Replies)
Discussion started by: gopal.biswal
6 Replies
LEARN ABOUT DEBIAN
log::report::dispatcher::file
Log::Report::Dispatcher::File(3pm) User Contributed Perl Documentation Log::Report::Dispatcher::File(3pm)NAME
Log::Report::Dispatcher::File - send messages to a file or file-handle
INHERITANCE
Log::Report::Dispatcher::File
is a Log::Report::Dispatcher
SYNOPSIS
dispatcher Log::Report::Dispatcher::File => 'stderr'
, to => *STDERR, accept => 'NOTICE-';
# close a dispatcher
dispatcher close => 'stderr';
# let dispatcher open and close the file
dispatcher FILE => 'mylog', to => '/var/log/mylog'
, charset => 'utf-8';
...
dispatcher close => 'mylog'; # will close file
# open yourself, then also close yourself
open OUT, ">:encoding('iso-8859-1')", '/var/log/mylog'
or fault "...";
dispatcher FILE => 'mylog', to => *OUT;
...
dispatcher close => 'mylog';
close OUT;
# dispatch into a scalar
my $output = '';
open $outfile, '>', $output;
dispatcher FILE => 'into-scalar', to => $outfile;
...
dispatcher close => 'into-scalar';
print $output;
DESCRIPTION
This basic file logger accepts an file-handle or filename as destination.
METHODS
Constructors
$obj->close
Only when initiated with a FILENAME, the file will be closed. In any other case, nothing will be done.
Log::Report::Dispatcher::File->new(TYPE, NAME, OPTIONS)
-Option--Defined in --Default
accept Log::Report::Dispatcher depend on mode
charset Log::Report::Dispatcher LOCALE
format_reason Log::Report::Dispatcher 'LOWERCASE'
locale Log::Report::Dispatcher <system locale>
mode Log::Report::Dispatcher 'NORMAL'
replace false
to <required>
accept => REASONS
charset => CHARSET
format_reason => 'UPPERCASE'|'LOWERCASE'|'UCFIRST'|'IGNORE'|CODE
locale => LOCALE
mode => 'NORMAL'|'VERBOSE'|'ASSERT'|'DEBUG'|0..3
replace => BOOLEAN
Only used in combination with a FILENAME: throw away the old file if it exists. Probably you wish to append to existing information.
Use the LOCALE setting by default, which is LC_CTYPE or LC_ALL or LANG (in that order). If these contain a character-set which Perl
understands, then that is used, otherwise silently ignored.
to => FILENAME|FILEHANDLE|OBJECT
You can either specify a FILENAME, which is opened in append mode with autoflush on. Or pass any kind of FILE-HANDLE or some OBJECT
which implements a "print()" method. You probably want to have autoflush enabled on your FILE-HANDLES.
When cleaning-up the dispatcher, the file will only be closed in case of a FILENAME.
Accessors
$obj->filename
Returns the name of the opened file, or "undef" in case this dispatcher was started from a file-handle or file-object.
$obj->isDisabled
See "Accessors" in Log::Report::Dispatcher
$obj->mode
See "Accessors" in Log::Report::Dispatcher
$obj->name
See "Accessors" in Log::Report::Dispatcher
$obj->needs
See "Accessors" in Log::Report::Dispatcher
$obj->type
See "Accessors" in Log::Report::Dispatcher
Logging
$obj->collectLocation
Log::Report::Dispatcher::File->collectLocation
See "Logging" in Log::Report::Dispatcher
$obj->collectStack([MAXDEPTH])
Log::Report::Dispatcher::File->collectStack([MAXDEPTH])
See "Logging" in Log::Report::Dispatcher
$obj->log(HASH-of-OPTIONS, REASON, MESSAGE)
See "Logging" in Log::Report::Dispatcher
$obj->stackTraceLine(OPTIONS)
Log::Report::Dispatcher::File->stackTraceLine(OPTIONS)
See "Logging" in Log::Report::Dispatcher
$obj->translate(HASH-of-OPTIONS, REASON, MESSAGE)
See "Logging" in Log::Report::Dispatcher
SEE ALSO
This module is part of Log-Report distribution version 0.94, built on August 23, 2011. Website: http://perl.overmeer.net/log-report/
LICENSE
Copyrights 2007-2011 by Mark Overmeer. For other contributors see ChangeLog.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See
http://www.perl.com/perl/misc/Artistic.html
perl v5.14.2 2011-08-23 Log::Report::Dispatcher::File(3pm)