Sponsored Content
Full Discussion: comma delimiter and space
Top Forums Shell Programming and Scripting comma delimiter and space Post 302369124 by mkastin on Friday 6th of November 2009 01:44:01 PM
Old 11-06-2009
Code:
sed 's/ //g' file > file

this will remove all spaces anywhere in the file.

Code:
$ cat test
Column1,Column2,Colum3,Column4
,x,y,z
,d,c,v
t,l,m,n
,h,s,k
,k,,y
z,j, ,p
$ sed 's/ //g' test
Column1,Column2,Colum3,Column4
,x,y,z
,d,c,v
t,l,m,n
,h,s,k
,k,,y
z,j,,p


Last edited by mkastin; 11-06-2009 at 02:45 PM.. Reason: Added example input and output
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Space as a delimiter

not sure if i'm doing this right i'm new tho this but i'm trying to use a space as a delimiter with the cut command my code is size=$( du -k -S -s /home/cmik | cut -d' ' -f1 ) i've also tried -f2 and switching the -d and -f around if that does anything (3 Replies)
Discussion started by: Cmik
3 Replies

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

3. Shell Programming and Scripting

Replacing Comma delimiter coming inside the data.

Hello, I am having flat file (Comma Delimiter) and the data in the file is as given below. EMPNO, ENAME, DESIGNATION, SALARY 10979, Arun Kumar, Cosultant, 35000 13555, Bidhu Shekar, Senior Consultant, 45000 15000, Kiran, Kumar, Senior, Consultant, 40000 If... (9 Replies)
Discussion started by: arunvasu2
9 Replies

4. UNIX for Dummies Questions & Answers

Making a Tab delimiter file to Comma

How can i make a tab delimiter file to a comma delimiter??? (13 Replies)
Discussion started by: saggiboy10
13 Replies

5. Shell Programming and Scripting

nawk won't accept comma as delimiter

I have a text file delimited by commas, with three fields (no " marks). I want to use awk to create a fourth field which is equal to the line number + field 1 + .txt I've searched this forum and found the following nawk -v OFS=';' '{print $0, FNR}' myFile Which I've amended to change the... (2 Replies)
Discussion started by: b.hamilton
2 Replies

6. Shell Programming and Scripting

Substituting comma "," for dot "." in a specific column when comma"," is a delimiter

Hi, I'm dealing with an issue and losing a lot of hours figuring out how i would solve this. I have an input file which looks like this: ('BLABLA +200-GRS','Serviço ','TarifaçãoServiço','wap.bla.us.0000000121',2985,0,55,' de conversão em escada','Dia','Domingos') ('BLABLA +200-GRR','Serviço... (6 Replies)
Discussion started by: poliver
6 Replies

7. Shell Programming and Scripting

Change the delimiter from Comma to Pipeline

Hello All, I need to convert a csv file to pipeline delimiter file in UNIX. The data in file itself contains comma with double qouted qualifier apart from the comma separator. Let me know how to do it. Appreciate any help if awk can be used to do it. Mentioned below is the sample record of... (14 Replies)
Discussion started by: Arun Mishra
14 Replies

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

9. Shell Programming and Scripting

Need to use delimiter as : and space in awk

Hi , Please suggest me how do I use : (colon and one space) as a delimiter in awk Best regards, Vishal (2 Replies)
Discussion started by: Vishal_dba
2 Replies

10. Shell Programming and Scripting

Insert a new column with sequence number (Delimiter as comma)

Hi All, I have a file which has data like a,b c,d e,f g,h And I need to insert a new column at the begining with sequence no( 1 to n) 1,a,b 2,c,d 3,e,f 4,g,h Please let me know how to acheive this in unix (3 Replies)
Discussion started by: weknowd
3 Replies
ODBC_FETCH_ROW(3)							 1							 ODBC_FETCH_ROW(3)

odbc_fetch_row - Fetch a row

SYNOPSIS
bool odbc_fetch_row (resource $result_id, [int $row_number]) DESCRIPTION
Fetches a row of the data that was returned by odbc_do(3) or odbc_exec(3). After odbc_fetch_row(3) is called, the fields of that row can be accessed with odbc_result(3). PARAMETERS
o $result_id - The result identifier. o $row_number - If $row_number is not specified, odbc_fetch_row(3) will try to fetch the next row in the result set. Calls to odbc_fetch_row(3) with and without $row_number can be mixed. To step through the result more than once, you can call odbc_fetch_row(3) with $row_number 1, and then continue doing odbc_fetch_row(3) without $row_number to review the result. If a driver doesn't support fetching rows by number, the $row_number parameter is ignored. RETURN VALUES
Returns TRUE if there was a row, FALSE otherwise. PHP Documentation Group ODBC_FETCH_ROW(3)
All times are GMT -4. The time now is 07:45 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy