Making a Tab delimiter file to Comma


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Making a Tab delimiter file to Comma
# 1  
Old 01-30-2012
Making a Tab delimiter file to Comma

How can i make a tab delimiter file to a comma delimiter???
# 2  
Old 01-30-2012
Code:
awk -F, -v OFS="\t" '{ $1=$1 } 1' filename > outfile

# 3  
Old 01-30-2012
got these errors

awk: syntax error near line 1
awk: bailing out near line 1
# 4  
Old 01-30-2012
Nothing in that ought to cause that error. Type it more carefully, word for word, letter for letter, keystroke for keystroke.

Use nawk on solaris of course, but even solaris awk would've caused a different error, I think.
# 5  
Old 01-30-2012
Code:
perl -plne 's/\t/,/g' input_file > output_file

# 6  
Old 01-31-2012
Issue persists..Getting the same error...Can you please test it from your end as well?
# 7  
Old 01-31-2012
I did before I posted it.

Can you show me exactly what you're typing, word for word, letter for letter, keystroke for keystroke?
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Replace comma delimiter by newline

The input file is as below AR,age,marks,roll,section,evin,25,80,456,A,atch,23,56,789,B,eena,24 ,78H245,C,Ps,ot,ecessary,hat,ame comes first then age and rest AR AZ,kevin,25,80,456,A,Satch,23,56,789,Satch,23,56,789,B,Meena,24,78,H245,C,AZ ................ ................ I am writting... (8 Replies)
Discussion started by: millan
8 Replies

2. Shell Programming and Scripting

how to convert comma delimited file to tab separator

Hi all, How can i convert comma delimited .csv file to tab separate using sed command or script. Thanks, Krupa (4 Replies)
Discussion started by: krupasindhu18
4 Replies

3. Shell Programming and Scripting

Exporting data into Comma Delimiter.

Hi, Requirement: Exporting data from Oracle to UNIX into "Comma" delimiter. Help Needed: I was able to connect to Oracle and import the data. But please let me know while importing the data I need to make it into Comma delimiter flat file. For Example: Source Data - 100 ABC TLead... (6 Replies)
Discussion started by: arunvasu2
6 Replies

4. Shell Programming and Scripting

comma delimiter and space

I have a csv file and there is a problem which I need to resolve. Column1,Column2,Colum3,Column4 ,x,y,z ,d,c,v t,l,m,n ,h,s,k ,k,,y z,j, ,p Now if you see column1 for row 1 and row 4 though they are null there is a space but in case of row2 and row 5 there is no space. I want row... (3 Replies)
Discussion started by: RubinPat
3 Replies

5. UNIX for Dummies Questions & Answers

Delimiter: Tab or Space?

Hello, Is there a direct command to check if the delimiter in your file is a tab or a space? And how can they be converted from one to another. Thanks, G (4 Replies)
Discussion started by: Gussifinknottle
4 Replies

6. UNIX for Dummies Questions & Answers

Replacing Comma by Tab

Hi All, i have a file test.txt as shown below, 1,test,test111 2,rest,rest222 i want to replace the commas by tab delimiter.., it should be like, 1 test test111 2 rest rest222 i tried the following code, sed 's/,/\\t/g' test.txt >> ouptut.txt (9 Replies)
Discussion started by: Serious Sam
9 Replies

7. Shell Programming and Scripting

replace comma(,) with Tab

hi all, i have a file with commas(,). i want to replace all the commas with tab(\t). Plz help...its urgent... (3 Replies)
Discussion started by: vikas_kesarwani
3 Replies

8. Shell Programming and Scripting

append data in a file by using tab delimiter

Hi, I need to append the data in to a file by using tab delimiter. eg: echo "Data1" >> filename.txt echo "\t" >> filename.txt (its not working) echo "Data2" >> filename.txt. the result sould be like this. Data1 Data2 (6 Replies)
Discussion started by: Sharmila_P
6 Replies

9. Shell Programming and Scripting

Cutting a tab delimiter file

I have a 30 column tab delimited record file. I need to extract the first 10column. The following command to cut was not working cut -f 1-10 -d "\t" filename. Could any one keep on this . Thanks in Advance (4 Replies)
Discussion started by: vinod.thayil
4 Replies

10. Shell Programming and Scripting

Converting Tab delimited file to Comma delimited file in Unix

Hi, Can anyone let me know on how to convert a Tab delimited file to Comma delimited file in Unix Thanks!! (22 Replies)
Discussion started by: charan81
22 Replies
Login or Register to Ask a Question