I want to add few columns after the 2nd column and then append rest of the columns after the 3rd newly added column.
After adding fields the file should look like this
I can do this by iterating line through the lines
redirecting to a new file and renaming the new file to original file once all the lines are processed.
Is there any easy way to do this in awk or sed.
I need to insert data into a perticular field of a csv file, lets say second field.
Can any one help me to do this?
I found that we can do it with sed. can any one guide me to accomplish this?
thanks in advance. (12 Replies)
SHELL SCRIPT
Hi,
I have 3 separate files within a folder. Every File contains data in a single column like
File1 contains data
mayank
sushant
dheeraj
File2 contains
DSA_AT
MG_AT
FLAT_09
File3 contains data
123123
232323 (2 Replies)
Hi,
I have a requirment where I need to pull different columns from a .csv file.
Here is the sample of the csv file.
account,item,flag1,flag2,flag3,flag4,flag5,......feed,tran
I will be have a config.txt file which will have the following information.
item,flag5,flag10,feed,tran... (2 Replies)
Hi All,
I want to remove the rows from File1.csv by comparing the columns/fields in the File2.csv. I only need the records whose first column is same and the second column is different for the same record in both files.Here is an example on what I need.
File1.csv:
RAJAK|ACTIVE|1... (2 Replies)
Hello
I have a csv file which I need to insert addtional commas into. The csv is of the format
field1,field2,field3,field4,...etc...,field13,field14
I need to add extra commas in each record so that the final output looks like
... (1 Reply)
Hi Tech Guru,
I have a test file as below , which needs some more fields to be populated randomly :
dks3243;12;20130823;1420;25m;0;syt
dks3243;rocy;10
dks3243;kiop;18
sde21p4;77;20151210;8479;7py;9;vfr
sde21p4;temp;67
sfq6i01;12;20120123;3412;4rd;7;jui
sfq6i01;uymk;90
sfq6i01;kiop;51
... (8 Replies)
Hi,
i have a csv file which have headers and values of it like below :
headers --> CI Ref SerialNumber LastScanDate
values --> VMware-42,VMware-42,Tue, 20 May 2014 11:03:44 +0000
i want to have a above csv in below format :
headers --> CI Name CI Description CI Ref... (6 Replies)
I have a csv file which is produced out of a SED command sed 's/|/","/g; s/^/"/; s/$/"/' A4.txt > A5.csv and I need either an addition to the SED command or a separate command to convert the following characters which occur within the fields in multiple lines
1) "=" to ="
and
2)""~ to " (4 Replies)
I'm trying to use awk to count the occurrences of two matching fields of a CSV file.
For instance, for data that looks like this...
Joe,Blue,Yes,No,High
Mike,Blue,Yes,Yes,Low
Joe,Red,No,No,Low
Joe,Red,Yes,Yes,Low
I've been trying to use code like this...
countvar=`awk ' $2~/$color/... (4 Replies)
I am trying to parse two csv files and make a match in one column then print the entire file to a new file and append an additional column that gives description from the match to the new file. If a match is not made, I would like to add "NA" to the end of the file
Command that Ive been using... (6 Replies)
Discussion started by: dis0wned
6 Replies
LEARN ABOUT DEBIAN
cddb_get
CDDB_get(3pm) User Contributed Perl Documentation CDDB_get(3pm)NAME
CDDB - Read the CDDB entry for an audio CD in your drive
SYNOPSIS
use CDDB_get qw( get_cddb );
my %config;
# following variables just need to be declared if different from defaults
$config{CDDB_HOST}="freedb.freedb.org"; # set cddb host
$config{CDDB_PORT}=8880; # set cddb port
$config{CDDB_MODE}="cddb"; # set cddb mode: cddb or http
$config{CD_DEVICE}="/dev/cdrom"; # set cd device
# user interaction welcome?
$config{input}=1; # 1: ask user if more than one possibility
# 0: no user interaction
# get it on
my %cd=get_cddb(\%config);
unless(defined $cd{title}) {
die "no cddb entry found";
}
# do somthing with the results
print "artist: $cd{artist}
";
print "title: $cd{title}
";
print "category: $cd{cat}
";
print "cddbid: $cd{id}
";
print "trackno: $cd{tno}
";
my $n=1;
foreach my $i ( @{$cd{track}} ) {
print "track $n: $i
";
$n++;
}
DESCRIPTION
This module/script gets the CDDB info for an audio cd. You need LINUX, SUNOS or *BSD, a cdrom drive and an active internet connection in
order to do that.
INSTALLATION
Run "perl Makefile.pl" as usual. ("make", "make install" next)
LICENSE & DISCLAIMER
This library is released under the same conditions as Perl, that is, either of the following:
a) the GNU General Public License Version 2 as published by the Free Software Foundation,
b) the Artistic License.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See either the GNU General Public License or the Artistic License for more details.
You should have received a copy of the Artistic License with this Kit, in the file named "Artistic". If not, I'll be glad to provide one.
You should also have received a copy of the GNU General Public License along with this program, in the file names "Copying"; if not, write
to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
If you use this library in a commercial enterprise, you are invited, but not required, to pay what you feel is a reasonable fee to the
author, who can be contacted at armin@xos.net
AUTHOR & COPYRIGHT
(c) 2003 Armin Obersteiner <armin(at)xos(dot)net>
SEE ALSO perl(1), Linux: /usr/include/linux/cdrom.h, Solaris, *BSD: /usr/include/sys/cdio.h.
perl v5.14.2 2012-03-06 CDDB_get(3pm)