CSV format help


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting CSV format help
# 1  
Old 05-24-2012
CSV format help

Hi team,

In simple way i will explain.. i have a shell script which gives morethan one output

Code:
echo"some code" ----> it gives one output
echo"some code" ----> it gives one output
echo"some code" ----> it gives one output
echo"some code" ----> it gives one output

i want all this to put in one csv file.. I tried below possibilities but not getting expected output
Code:
echo"some code">MS.csv  ----> it gives one output
echo"some code">MS.csv  ----> it gives one output
echo"some code">MS.csv  ----> it gives one output
echo"some code">MS.csv  ----> it gives one output

in this scenario it is giving output of only last one and not giving remaining three outputs
Code:
echo"some code">>MS.csv  ----> it gives one output
echo"some code">>MS.csv  ----> it gives one output
echo"some code">>MS.csv  ----> it gives one output
echo"some code">>MS.csv  ----> it gives one output

here i am getting the output what i expect.. but when i run this script for new scenario previous output is coming.
Please helpme out on this

---------- Post updated at 05:23 AM ---------- Previous update was at 05:01 AM ----------

i got expected output from below script Smilie

Code:
echo"some code">MS.csv  ----> it gives one output
echo"some code">>MS.csv  ----> it gives one output
echo"some code">>MS.csv  ----> it gives one output
echo"some code">>MS.csv  ----> it gives one output

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Converting csv to html format

Below is the code I have - How can I convert the data in the csv into 3 tables in html. instead of 1 table. Attached is the format I am getting. (1 Reply)
Discussion started by: archana25
1 Replies

2. Shell Programming and Scripting

Format csv file

Hi, I need to make some changes in a csv file using awk or perl. Unfortunately, all my attempts have led to nothing so I hope you guys can help me. I have the following example input file including header(original file has 35 fields): ABC: DE Time: 2012/09/07... (3 Replies)
Discussion started by: Subbeh
3 Replies

3. Shell Programming and Scripting

Converting CSV to ascii format

Hej All, I have a file like this which is a comma dilimited: input: 6000318,-263.011520678,-59.05869872409,587.67924868792 6000319,-265.6996842902,-50.24902479999,590.65693082607 6000320,-238.1333898366,-288.801232595,633.75332173496... (5 Replies)
Discussion started by: Johanni
5 Replies

4. UNIX Desktop Questions & Answers

Format csv file using Unix

Hi All, I have an csv file with three rows, where first containing header deatils. is there any way to make the first row to appear bold using UNIX command. Input File: Name Rank arun 1 babu 2 Expected Output: Name Rank arun 1 babu 2 (7 Replies)
Discussion started by: arunmanas
7 Replies

5. Shell Programming and Scripting

How to parse csv format?

Hi, I have a file with 3 fields in csv format: /tmp/foo/,MODIFY,bar/toto "/tmp/foo, bar/","ATTRIB,ISDIR","toto, tata/foobar"I would like to split fields in order to obtain the following: Line1: /tmp/foo/ MODIFY bar/totoLine2: /tmp/foo, bar/ ATTRIB,ISDIR toto, tata/foobarCan't find my way... (11 Replies)
Discussion started by: chebarbudo
11 Replies

6. Shell Programming and Scripting

Retaining the Unix CSV format in Excel format while exporting

Hi All, I have created a Unix Shell script whch creates a *.csv file and export it to Excel. The problem i am facing is that Users wants one of the AMOUNT field in comma separted values. Example : if the Amount has the value as 3000000 User wants to be in 3,000,000 format. This Amount format... (2 Replies)
Discussion started by: rawat_me01
2 Replies

7. Shell Programming and Scripting

Format CSV file

I have a csv file which I need to process and export back to xlsx file. For instance, the csv contains: John Smith, job-title, hours John Smith, job-title, hours Mary Smith job-title, hours etc. I need to import that to a script, get id of redundant data i.e: John smith, job-title,... (13 Replies)
Discussion started by: _tina_
13 Replies

8. Shell Programming and Scripting

AWK CSV to TXT format, TXT file not in a correct column format

HI guys, I have created a script to read 1 column in a csv file and then place it in text file. However, when i checked out the text file, it is not in a column format... Example: CSV file contains name,age aa,11 bb,22 cc,33 After using awk to get first column TXT file... (1 Reply)
Discussion started by: mdap
1 Replies

9. Shell Programming and Scripting

CSV format problem

studentNo=$1 tmp=/tmp/acc2courses$ID.$$ grep -w "$studentNo" CSE1001 >/dev/null 2>&1 && echo CSE1001 >>$tmp grep -w "$studentNo" CSE1002 >/dev/null 2>&1 && echo CSE1002 >>$tmp grep -w "$studentNo" CSE9001 >/dev/null 2>&1 && echo CSE9001 >>$tmp This is my code, The output in tmp file... (10 Replies)
Discussion started by: ccwq
10 Replies

10. UNIX for Advanced & Expert Users

How to Parse a CSV file into a Different Format

Hi I have a CSV file with me in this format Currency, USD, EUR, USD, 1.00, 1.32, EUR, 0.66, 1.00, How do I transpose the file to get to the format below. currency, currency, rate USD, USD, 1.00 USD, EUR, 1.32 EUR, USD, 0.66 EUR, EUR, 1.00 Thanks for your help We are using... (2 Replies)
Discussion started by: cdesiks
2 Replies
Login or Register to Ask a Question