Sponsored Content
Top Forums Shell Programming and Scripting How to Use Sed Command to replace white spaces with comma from between two fields - Mayank Post 302435373 by mayanksargoch on Wednesday 7th of July 2010 07:12:23 AM
Old 07-07-2010
Data

Hi Guru

Actually i took output of a MySql query (the result had 2 columns) into a file. There is white space between the values of two separate columns.

I tried saving it as a CSV file but it did not work. And the sed command u have given or the ones i have tried do not work either.

---------- Post updated at 04:42 PM ---------- Previous update was at 04:39 PM ----------

Hi,

The data within the file is like :

2000020354 Testing
2000020351 Sagar
2000020342 Hello
2000020334 asdsadsda
2000020329 Hello
2000020328 samir
2000020328 sameer

Its not multiple spaces but a single tab. and yet no sed command is working. Is it due to the reason that i saveed the result from a Mysql Query??
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Replace only first found white spaces with some other characters

Anybody can help me How can I replace only four first white spaces with , or any other characters aaaa 08/31/2004 08/31/2009 permanent Logical Processors in System: 64 bedad 08/16/2001 08/15/2011 permanent Logical Processors in System: 64 badnv14 05/31/2008 05/30/2013 permanent Logical... (5 Replies)
Discussion started by: pareshan
5 Replies

2. Shell Programming and Scripting

Help with sed and replacing white spaces with commas

Dear all, I am in a bit of a quandary. I have 400 text files which I need to edit and output in a very specific way. Here is a sample text file copied from gedit ... The columns will come out a bit messed up but when I cat <file>, it gives a table with six columns (0-28, tot lob vol, vcsf,... (6 Replies)
Discussion started by: antonz
6 Replies

3. Shell Programming and Scripting

Include white spaces while using CUT command

Hi I tried to extract 19 characters (default) enclosed with in tag from a file using cut command. If the characters comprises of double space, the cut command gives the output with a single spacing. file 1 <name>Kumar Rajasekaran</name> cut -c7-26 "file1" the out put i received is ... (48 Replies)
Discussion started by: Sekar1
48 Replies

4. AIX

Replace all TAB characters with white spaces

Dear Gurus Can you please advise me on how to Replace all TAB characters with white spaces in a text file in AIX? Either using vi or any utilities (2 Replies)
Discussion started by: tenderfoot
2 Replies

5. Shell Programming and Scripting

Replace white spaces of multiple files at once

How to rename multiple files by replacing the white spaces with underscore for ex: 293TrexFH\ \ \ GSM855007RINGB_lhb11_binary.txt 293TrexFH\ \ \ GSM855007RINGB_lhb12_binary.txt 293TrexFH\ \ \ GSM855007RINGB_lhb13_binary.txt 293TrexFH_GSM855007RINGB_lhb11_binary.txt... (1 Reply)
Discussion started by: quincyjones
1 Replies

6. UNIX for Dummies Questions & Answers

How to replace two or more spaces with one comma?

I'm using sh on hp-ux. I've got a file that looks like this. -5.65 175 -16.17 160 -13.57 270 -51.72 260 -8.30 360 -42.71 460 -.38 375 -.20 375 -4.15 170 -21.53 560 -18.84 360 I'd like to replace all the whitespace between the columns with one comma. I can't... (4 Replies)
Discussion started by: Scottie1954
4 Replies

7. Shell Programming and Scripting

How to replace NewLine with comma using sed?

Hi , I have a huge file with following records and I want to replace the last comma with ',NULL'. I try using SED but could not create a correct script . In my opinion I need a script which can convert ,/n with ,NULL/n 1,CHANGE_MEMBER,2010-12-28 00:05:00, 2,CHANGE_MEMBER,2012-09-02... (8 Replies)
Discussion started by: Ajaypal
8 Replies

8. Shell Programming and Scripting

Shell command to Strip white spaces at specific location

Hello, I have a Comma separated input file with one of the sample records as below: -9223372036854477528,"834","834003325515BXNI00101012013C","5","PLAN_VALUE","PPO, General Cable","C",20130101,99991231,"A","2012-12-25-13.58.14.434000","ZPL2 ","2012-12-25-13.58.14.434000","ZPL2 ... (4 Replies)
Discussion started by: Praveenkulkarni
4 Replies

9. Shell Programming and Scripting

Replace spaces with underscores up to first comma but not after the comma

I have a comma delimited file of major codes and descriptions. I want to replace all occurrences of spaces with underscores up to the first comma (only in the first field), but not replace spaces following the comma. For instance I have the following snippet of the file: EK ED,Elementary and... (7 Replies)
Discussion started by: tdouty
7 Replies

10. UNIX for Beginners Questions & Answers

How to extract fields from a CSV i.e comma separated where some of the fields having comma as value?

can anyone help me!!!! How to I parse the CSV file file name : abc.csv (csv file) The above file containing data like abv,sfs,,hju,',',jkk wff,fst,,rgr,',',rgr ere,edf,erg,',',rgr,rgr I have a requirement like i have to extract different field and assign them into different... (4 Replies)
Discussion started by: J.Jena
4 Replies
KUMOCTL(1)						      General Commands Manual							KUMOCTL(1)

NAME
kumoctl - show kumofs status SYNOPSIS
kumoctl address[:port=19750] command [options] DESCRIPTION
Show status of kumo-manager and send control commands to kumo-manager. COMMANDS
status show status of the cluster attach attach all new servers and start replace attach-noreplace attach all new servers detach detach all fault servers and start replace detach-noreplace detach all fault servers replace start replace without attach/detach full-replace start full-replace (repair consistency) backup [suffix=20090304] create backup with specified suffix enable-auto-replace enable auto replace disable-auto-replace disable auto replace STATUS
hash space timestamp The time that the list of attached kumo-servers is updated. It is updated when new kumo-server is added or existing kumo-server is down. attached node The list of attached kumo-servers. (active) is normal node and (fault) is fault node or recoverd but not re-attached node. not attached node The list of recognized but not-attached nodes. AUTO REPLACING
By default, you have to attach new kumo-servers manually using kumoctl command. If the auto replacing is enabled, new kumo-servers are attached automatically. This is experimental feature. EXAMPLE
$ kumoctl mgr1 status $ kumoctl mgr1 attach SEE ALSO
kumo-manager(1). kumoctl July 2009 KUMOCTL(1)
All times are GMT -4. The time now is 11:36 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy