Exporting text file data to csv


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Exporting text file data to csv
# 1  
Old 09-16-2005
Exporting text file data to csv

Could any one help me in basic shell script to export text file data to csv.
I need to export only particular data from text file to csv column.
I am a newbie to UNIX could anyone help me with sample script code
# 2  
Old 09-16-2005
MySQL

post some extract from your data file and the way you wish to see the output.
# 3  
Old 09-17-2005
elapsed = 76.38 seconds, average = 0.352 seconds, minimum = 0.159 elapsed = 379.005 seconds, average = 0.379 seconds, minimum = 0.157 elapsed = 683.99 seconds, average = 0.455 seconds, minimum = 0.156 elapsed = 1043.271 seconds, average = 0.521 seconds, minimum = 0.154 elapsed = 1408.594 seconds, average = 0.563 seconds, minimum = 0.154


i need to export this data to csv like
elapsed average minimum

176.38 0.352 0.159
x.aaa y.aaaa z.aaaa
x.aaa y.aaaa z.aaaa
x.aaa y.aaaa z.aaaa
x.aaa y.aaaa z.aaaa
# 4  
Old 09-19-2005
Try...
Code:
#!/usr/bin/bash
set $(<file1)
while [[ $# -gt 0 ]]
do
  echo $3,$7,${11}
  shift 11
done

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

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

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

3. Shell Programming and Scripting

Converting data for text file to csv

Gents Using the script attached (raw2csv). i use to create the file .csv.. The input file is called 201.raw. Kindly can you check if there is easy way to do it. The script works fine but takes a lot time to process Thanks for your help (8 Replies)
Discussion started by: jiam912
8 Replies

4. Shell Programming and Scripting

Filtering data from text to csv

Hello, Is there a way to filerter data from a text file as shown below to a Column e.g. hostname nfsmount as two separate column. Currently I could get hostname and the mount is appearing below.. using this script #! /bin/bash for i in `cat fqdn.txt` do echo "$i ............ " >>... (3 Replies)
Discussion started by: Cy Pqa
3 Replies

5. Shell Programming and Scripting

Text file to CSV with field data separated by blank lines

Hello, I have some data in a text file where fields are separated by blank lines. There are only 6 fields however some fields have several lines of data as I will explain. Also data in a particular field is not consistently the same size but does end on a blank line. The first field start with... (6 Replies)
Discussion started by: vestport
6 Replies

6. Shell Programming and Scripting

Remove duplicate commas after exporting excel file to csv

Hello everyone I'm new here and this is my first post so first of all I want to say that this is a great forum and I have managed to found most of my answers in these forums : ) So with that I ask you my first question: I have an excel file which I saved as a csv. However the excel file... (3 Replies)
Discussion started by: Spunkerspawn
3 Replies

7. Shell Programming and Scripting

Exporting data as a CSV file from Unix shell script

Friends...This is the first time i am trying the report generation using shell script... any suggestions are welcome. Is there a way to set the font size & color when i am exporting the data from unix shell script as a CSV file ? The following sample data is saved as a .csv file in the... (2 Replies)
Discussion started by: appu2176
2 Replies

8. Shell Programming and Scripting

Exporting .csv file into mysql server 2005 using script.

Hi, I have a .csv file created by a script with data in a tabular format. I need to insert all the value into mysql database which is running in a different machine. what is the command to export the .csv file into database using shell script. Thanks in advance. (3 Replies)
Discussion started by: ahamed
3 Replies

9. Shell Programming and Scripting

Data fetched from text file and save in a csv file

Hi i have wriiten a script which fetches the data from text file, and saves in the output in a text file itself, but i want that the output should save in different columns. I have the output like: For Channel:response_time__24.txt 1547 data points 0.339 0.299 0.448 0.581 7.380 ... (1 Reply)
Discussion started by: rohitkalia
1 Replies

10. Shell Programming and Scripting

exporting number into .csv file in text form (no other extra charc) from shell script

I have written a k shell program which is executing a sql and exporting data in numeric form like 0412323444 into .csv file. the problem i am facing is that , the data is coming in excel formatted in scientific form like 4.1+E08,while my requirement is to store data as such 0412323444 in excel ( no... (5 Replies)
Discussion started by: Deepak_Rastogi
5 Replies
Login or Register to Ask a Question