Sponsored Content
Top Forums Shell Programming and Scripting Data Manipulation on a .csv file Post 302807711 by kekanap on Wednesday 15th of May 2013 08:37:29 AM
Old 05-15-2013
Data Manipulation on a .csv file

Hallo Friends,

I need you help. My file has 5000 or so lines and currently looks like below(sample).

Code:
Service Type,Origin,Destination,Rate Per Minute,Minimum Charge,Time Based Rate,Time Based From Day,Time Based To Day,Time Based From Time,Time Based To Time,Destination Prefix List,,
VoIS Community,Rest of RSA,Datacash Extend Calls,0.36,no,no,,,,,0215284571|0215284580|0215284655',,
VoIS Community,Rest of RSA,Maxi Call,0.17,no,no,,,,,'0861',,
VoIS Global,All Of RSA,Albania - Amc Fixed 2,1.96,no,no,,,,,'35547210|35547425|35547550|35547700|35547870|35548270|35548570|35548660|35548855|35549440|35549930',,

I would like the output to be like below:

Code:
VoIS Community,Rest of RSA,Datacash Extend Calls,0.36,no,no,,,,,0215284571
VoIS Community,Rest of RSA,Datacash Extend Calls,0.36,no,no,,,,,0215284580
VoIS Community,Rest of RSA,Datacash Extend Calls,0.36,no,no,,,,,0215284655',,
VoIS Community,Rest of RSA,Maxi Call,0.17,no,no,,,,,'0861',,
VoIS Global,All Of RSA,Albania - Amc Fixed 2,1.96,no,no,,,,,35547210
VoIS Global,All Of RSA,Albania - Amc Fixed 2,1.96,no,no,,,,,35547425
VoIS Global,All Of RSA,Albania - Amc Fixed 2,1.96,no,no,,,,,35547550
VoIS Global,All Of RSA,Albania - Amc Fixed 2,1.96,no,no,,,,,35547700
VoIS Global,All Of RSA,Albania - Amc Fixed 2,1.96,no,no,,,,,35547870
VoIS Global,All Of RSA,Albania - Amc Fixed 2,1.96,no,no,,,,,35548270
VoIS Global,All Of RSA,Albania - Amc Fixed 2,1.96,no,no,,,,,35548570
VoIS Global,All Of RSA,Albania - Amc Fixed 2,1.96,no,no,,,,,35548660
VoIS Global,All Of RSA,Albania - Amc Fixed 2,1.96,no,no,,,,,35548855
VoIS Global,All Of RSA,Albania - Amc Fixed 2,1.96,no,no,,,,,35549440
VoIS Global,All Of RSA,Albania - Amc Fixed 2,1.96,no,no,,,,,35549930',,

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

csv file manipulation

Hi, I generated a csv file.But i have to manipulate it to make it user friendly. This is the structure of the input csv file. partyfailurereasonnumbercvfrejected12cvfapproved45cvfonhold23mvcunknown98mvconcall17pucapproved78puchold34actunknown19 The first line is the header. The... (6 Replies)
Discussion started by: amit.behera
6 Replies

2. Shell Programming and Scripting

Data manipulation from one file

HI all i have a file consisting of following numbers 0000 0000 0000 0000 0000 1010 0000 0100 0000 0000 0000 1111 0000 1010 0000 0100 (3 Replies)
Discussion started by: vaibhavkorde
3 Replies

3. Shell Programming and Scripting

Data manipulation from a file

i have a file in follwing format 0110 1020 1011 1032 1020 2005 2003 1050 i want the output in such a way that all non zero numbers will be converted into 1 like this 0110 1010 1011 1011 1010 1001 1001 1010 (3 Replies)
Discussion started by: vaibhavkorde
3 Replies

4. UNIX for Dummies Questions & Answers

Data file manipulation

Hi, I have two, double column data files (file1 and file2). I want to add the second column of file2 to as 3rd column of file1. But, the 3rd column values corresponds to the values of the 2nd column. example: file1: X Y ========= x1 y2 x3 y4 x2 y4 x5 y3 ========= file2: Y ... (7 Replies)
Discussion started by: gaurab
7 Replies

5. Shell Programming and Scripting

Awk to convert a text file to CSV file with some string manipulation

Hi , I have a simple text file with contents as below: 12345678900 971,76 4234560890 22345678900 5971,72 5234560990 32345678900 71,12 6234560190 the new csv-file should be like: Column1;Column2;Column3;Column4;Column5 123456;78900;971,76;423456;0890... (9 Replies)
Discussion started by: FreddyDaKing
9 Replies

6. Shell Programming and Scripting

CSV data format manipulation

Hi There I need a script which will pick up the data from a .CSV file and reformat it as per the requirement and write it to another .CSV file. I am using an application that will only take data in a particular format and need something that will convert without manual intervention. The... (4 Replies)
Discussion started by: rbggbr16
4 Replies

7. Shell Programming and Scripting

Manipulation of file data with UNIX

Hello , How all doing today.. I have a little doubt in Unix (6 Replies)
Discussion started by: adisky123
6 Replies

8. Shell Programming and Scripting

.csv file manipulation

Hall0 Team, I need you help. I have a .csv file called Pax.csv. It has 13 fields The fields that i am interested in is field 7, field 10(CallDuration),field 12 and field 13(TelkomAsif) Field 12(Cost) is affected by what is on field 7(CallType) if field7= VoIS Community Sharecall then Cost... (14 Replies)
Discussion started by: kekanap
14 Replies

9. Shell Programming and Scripting

Pax1.csv file manipulation

Hallo Team and happy Friday, I have a .csv file attached called MHG_Only_Billing_only_great_201408_SummaryDetails.csv The file is as below: $ cat MHG_Only_Billing_only_great_201408_SummaryDetails.csv... (1 Reply)
Discussion started by: kekanap
1 Replies

10. Shell Programming and Scripting

Compare 2 files of csv file and match column data and create a new csv file of them

Hi, I am newbie in shell script. I need your help to solve my problem. Firstly, I have 2 files of csv and i want to compare of the contents then the output will be written in a new csv file. File1: SourceFile,DateTimeOriginal /home/intannf/foto/IMG_0713.JPG,2015:02:17 11:14:07... (8 Replies)
Discussion started by: refrain
8 Replies
d2i_RSAPublicKey(3)						      OpenSSL						       d2i_RSAPublicKey(3)

NAME
d2i_RSAPublicKey, i2d_RSAPublicKey, d2i_RSAPrivateKey, i2d_RSAPrivateKey, d2i_RSA_PUBKEY, i2d_RSA_PUBKEY, i2d_Netscape_RSA, d2i_Net- scape_RSA - RSA public and private key encoding functions. SYNOPSIS
#include <openssl/rsa.h> RSA * d2i_RSAPublicKey(RSA **a, unsigned char **pp, long length); int i2d_RSAPublicKey(RSA *a, unsigned char **pp); RSA * d2i_RSA_PUBKEY(RSA **a, unsigned char **pp, long length); int i2d_RSA_PUBKEY(RSA *a, unsigned char **pp); RSA * d2i_RSAPrivateKey(RSA **a, unsigned char **pp, long length); int i2d_RSAPrivateKey(RSA *a, unsigned char **pp); int i2d_Netscape_RSA(RSA *a, unsigned char **pp, int (*cb)()); RSA * d2i_Netscape_RSA(RSA **a, unsigned char **pp, long length, int (*cb)()); DESCRIPTION
d2i_RSAPublicKey() and i2d_RSAPublicKey() decode and encode a PKCS#1 RSAPublicKey structure. d2i_RSA_PUKEY() and i2d_RSA_PUKEY() decode and encode an RSA public key using a SubjectPublicKeyInfo (certificate public key) structure. d2i_RSAPrivateKey(), i2d_RSAPrivateKey() decode and encode a PKCS#1 RSAPrivateKey structure. d2i_Netscape_RSA(), i2d_Netscape_RSA() decode and encode an RSA private key in NET format. The usage of all of these functions is similar to the d2i_X509() and i2d_X509() described in the d2i_X509(3) manual page. NOTES
The RSA structure passed to the private key encoding functions should have all the PKCS#1 private key components present. The data encoded by the private key functions is unencrypted and therefore offers no private key security. The NET format functions are present to provide compatibility with certain very old software. This format has some severe security weak- nesses and should be avoided if possible. SEE ALSO
d2i_X509(3) HISTORY
TBA 0.9.7a 2002-10-09 d2i_RSAPublicKey(3)
All times are GMT -4. The time now is 01:11 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy