How to make a CSV file from a Raw data


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers How to make a CSV file from a Raw data
# 1  
Old 12-06-2010
How to make a CSV file from a Raw data

Hi
Please help me on this.i have the Following data
i want to make it CSV file by a Unix Shell Script.


msgType : 234
( m_code : 0 # m_name : type # m_data : LOG )
[ MyIP-CAN-Type,{ ( m_code : 0 # m_name : MyIP-CAN-Type # m_data : 0 ) }]

pls help me on this
# 2  
Old 12-06-2010
Please mention your desired output.
R0H0N
# 3  
Old 12-06-2010
i want to make a simple CSV file ...where one row will give the id and respective value,another row will give m_code,m_name,m_data and respective values.........

pls help me on this
# 4  
Old 12-06-2010
Try:

for input

Quote:
msgType : 234
( m_code : 0 # m_name : type # m_data : LOG )
after executing following command

Code:
cat inputFile | sed 's/[!a-zA-Z0-9]/ /g' | sed 's/  */,/g'     # first sed will replace all characters except a-z,A-Z,0-9 with space and the second sed will replace multiple spaces with ,(comma)

output will looks like

Quote:
msgType,234
m_code,0,m_name,type,m_data,LOG
R0H0N
# 5  
Old 12-06-2010
How to put in a CSV file because i want a xxx.csv format
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Bash - make csv file

Hello, im trying to make csv file from a text file that it is the output of pssh command (multiple ssh ) now if i run the command date on all of our servers: i get this output : 14:02:46 192.168.25.230:22 Thu Jul 6 14:02:46 EEST 2017 192.168.70.230: Thu Jul 6 12:02:46 BST 2017 ... (1 Reply)
Discussion started by: batchenr
1 Replies

2. Shell Programming and Scripting

Read csv file, convert the data and make one text file in UNIX shell scripting

I have input data looks like this which is a part of a csv file 7,1265,76548,"0102:04" 8,1266,76545,"0112:04" I need to make the output data should look like this and the output data will be part of text file: 7|1265000 |7654899 |A| 8|12660000 |76545999 |B| The logic behind the... (6 Replies)
Discussion started by: RJG
6 Replies

3. 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

4. UNIX for Dummies Questions & Answers

Formatting data in a raw file by using another mapping file

Hi All, i have a requirement where i need to format the input RAW file ( which is CSV) by using another mapping file(also CSV file). basically i am getting feed file with dynamic headers by using mapping file (in that target field is mapped with source filed) i have to convert the raw file into... (6 Replies)
Discussion started by: ravi4informatic
6 Replies

5. Shell Programming and Scripting

Need help to make a csv file

Hi All :) Need help to create a csv file from some data which is extracted from input file Input file: 1. RUN DATE: 06/02/11 2. SYSTEM: EP0Z 3. PROBLEM TYPE: 0016 -------- ---- ---- 4. JOB NUMBER: 4301 5. JOB NAME:... (4 Replies)
Discussion started by: atul9806
4 Replies

6. Shell Programming and Scripting

How to extract data from csv file

Hello everybody, Here is my problem, I don't know anything about shell programming and my boss is actually asking me to develop a shell script in order to get values in a csv file from a specific date. Here is a sample of the csv file : Date;Enchaînement;Titre;Libellé ;calendrier;Heure début;Heure... (11 Replies)
Discussion started by: freyr
11 Replies

7. Shell Programming and Scripting

Put raw data to column data

Dear all, I want below data to make it in column format.so i will see the data like this cdrID teleServiceCode chargedPartyNumber ... ... ... ... "egmailcom0w10ggzx00" 'sMS (5)' "716323770" "m17ifi5z30w0z6o7200" 'sMS (5)' ... (7 Replies)
Discussion started by: Nayanajith
7 Replies

8. Shell Programming and Scripting

raw data to column data

I have a data file like this. SDPINPUTCDR.SDPCallDetailRecord.chargeEventCDR { cdrID : "egmailcom0w10ggzx00" teleServiceCode : 'sMS (5)' chargedPartyNumber : "716323770" otherPartyNumber : "een@gmail.com" time : "084127" date : "20070319" duration : "0" extensionInt1 : '4'D }... (3 Replies)
Discussion started by: Nayanajith
3 Replies

9. Shell Programming and Scripting

How to change Raw data to Coloumn data fields

Dear All, I have some data file.see below. --------------ALARM CLEARING FROM SubNetwork=ONRM_RootMo,SubNetwork=AXE,ManagedElement=CGSN-------------- Alarm Record ID: 25196304 Event Time: 2006-08-28 13:41:35 Event Type: ... (1 Reply)
Discussion started by: Nayanajith
1 Replies

10. UNIX for Advanced & Expert Users

copying data to raw devices using 'dd'

Hello all, I'm new here, so this information may exist elsewhere on this forum. If so, please point me in the right direction. Here's the problem. I'm trying to migrate Oracle data from an HP system to a Sun system using a raw device as a 'bridge' between the two systems. Both machines... (4 Replies)
Discussion started by: Neville
4 Replies
Login or Register to Ask a Question