Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Remove whitespaces between comma separated fields from file Post 302205164 by nitinbjoshi on Friday 13th of June 2008 08:21:00 PM
Old 06-13-2008
Remove whitespaces between comma separated fields from file

Hello all,

I am a unix dummy. I am trying to remove spaces between fields. I have the file in the following format


12332432, 2345 , asdfsdf ,100216 , 9999999
12332431, 2341 , asdfsd2 ,100213 , 9999999

& would like to make it

12332432,2345,asdfsdf,100216,9999999
12332431,2341,asdfsd2,100213,9999999

I would appreciate it greatly if there is a command to do this.

Thanks
Nitin
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Parse apart strings of comma separated data with varying number of fields

I have a situation where I am reading a text file line-by-line. Those lines of data contain comma separated fields of data. However, each line can vary in the number of fields it can contain. What I need to do is parse apart each line and write each field of data found (left to right) into a file.... (7 Replies)
Discussion started by: 2reperry
7 Replies

2. Shell Programming and Scripting

Comma separated file

Hi all, I have the following files types: FileA: 100, 23, 33, FileB: 22, 45, 78, and i want to make File C: 100,22 23,45 33,78 any nice suggestions for making it easy. (3 Replies)
Discussion started by: hen1610
3 Replies

3. Shell Programming and Scripting

Need Help - comma inside double quote in comma separated csv,

Hello there, I have a comma separated csv , and all the text field is wrapped by double quote. Issue is some text field contain comma as well inside double quote. so it is difficult to process. Input in the csv file is , 1,234,"abc,12,gh","GH234TY",34 I need output like below,... (8 Replies)
Discussion started by: Uttam Maji
8 Replies

4. Shell Programming and Scripting

How to split the comma separated file?

Hi, I have a filein unix like ABC,CDE BCD,KHL and the output i need is like column1 column2 ABC,CDE ABC ABC,CDE CDE BCD,KHL BCD BCD,KHL KHL. Can some body help me out? Hi, The code is working fine. But in my file each row does not have always 1 comma. It may... (6 Replies)
Discussion started by: jagdishrout
6 Replies

5. UNIX for Dummies Questions & Answers

[solved] Comma separated values to space separated

Hi, I have a large number of files which are written as csv (comma-separated values). Does anyone know of simple sed/awk command do achieve this? Thanks! ---------- Post updated at 10:59 AM ---------- Previous update was at 10:54 AM ---------- Guess I asked this too soon. Found the... (0 Replies)
Discussion started by: lost.identity
0 Replies

6. Shell Programming and Scripting

awk print - fields separated with comma's need to ignore inbetween double quotes

I am trying to re-format a .csv file using awk. I have 6 fields in the .csv file. Some of the fields are enclosed in double quotes and contain comma's inside the quotes. awk is breaking this into multiple fields. Sample lines from the .csv file: Device Name,Personnel,Date,Solution... (1 Reply)
Discussion started by: jxrst
1 Replies

7. Shell Programming and Scripting

awk to parse comma separated field and removing comma in between number and double quotes

Hi Experts, Please support I have below data in file in comma seperated, but 4th column is containing comma in between numbers, bcz of which when i tried to parse the file the column 6th value(5049641141) is being removed from the file and value(222.82) in column 5 becoming value of column6. ... (3 Replies)
Discussion started by: as7951
3 Replies

8. Shell Programming and Scripting

Convert fixed value fields to comma separated values

Hi All, Hope you are doing Great!!!. Today i have came up with a problem to say exactly it was for performance improvement. I have written code in perl as a solution for this to cut in specific range, but it is taking time to run for files thousands of lines so i am expecting a sed... (9 Replies)
Discussion started by: mad man
9 Replies

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

10. UNIX for Beginners Questions & Answers

Remove duplicates from comma separated list

Hi, I have following input file: niki niki niki1 niki niki2 niki,niki2 niki3 niki,niki3,niki niki4 niki4,blabla niki5 jkjkl niki6 niki60,niki6 I would like to delete lines with identical matches completely and remove the selfmatches in the other lines. ... (2 Replies)
Discussion started by: niki0211
2 Replies
MTKBABEL(1)						      General Commands Manual						       MTKBABEL(1)

NAME
mtkbabel - Tool for managing GPS data loggers based on the MTK chip SYNOPSIS
mtkbabel [-abcdEfhiIlmopRrstvwx] DESCRIPTION
mtkbabel is a command line program to operate GPS data loggers based on the MediaTek MTK chip. It was tested on the i-Blue 747, Qstarz BT- Q1000 and on the Holux M-241, it should work also with other GPS devices based on the same chip. The main features are: - Command line interface - Save data log in GPX and raw binary format - If required retrieve all the data, also the old one being overlapped - Change logging criteria: time, distance, speed - Change log format - START/STOP logging - Set OVERLAP or STOP method on memory full - Erase the internal memory USAGE
In order to use mtkbabel, please follow these instructions: 1. Attach the GPS data logger device to your computer via USB. 2. Now you have to switch the GPS device (at least the i-Blue 747) into LOG or NAV mode, otherwise the device will not be powered on, and no connection will be possible. Beware that in NAV mode the device goes into sleep mode if not connected to any Bluetooth device. 3. In order to use mtkbabel you have to either be root (not recommended) and/or you must have read/write permissions for the USB device file, usually /dev/ttyUSB0. This device usually has permissions 'crw-rw---- 1 root dialout', so you can either add your user to the dialout group (in this example) by doing $ adduser USERNAME dialout or (not recommended) make the device world-readable/-writable by doing: $ chmod 666 /dev/ttyUSB0 Another option is to write a udev rules file to change the owner and permissions of /dev/ttyUSB0 according to your requirements. 4. You can now run mtkbabel. For example, if you want to download the track log and the list of waypoints you captured on the device, run: $ mtkbabel -s 115200 -l off -f foo -w -t The default speed of 115200 baud should work in most cases and you can omit it, for the Holux M-241 you must use 38400 instead. This will turn off the autolog function, which is always turned on when you switch on the device. The track log will be in the file foo_trk.gpx, the waypoints in the file foo_wpt.gpx (both in GPX format). The file foo.bin will contain the binary log file. Downloading the data from the GPS device can take several minutes, depending on how much data has to be transferred. In order to delete all data from the GPS device, run: $ mtkbabel -s 115200 -E OPTIONS
-a Read all the log memory (overlapped data). -b filename.bin Do not read data from a GPS device, but rather read a previously saved .bin file. Ignore -f option. -c Create a GPX file with both tracks and waypoints. -d debug_level Debug level: 0..7. -E Erase data log memory. -f Base name for saved files (.bin and .gpx). If you, for example, use -f gpslog, mtkbabel will create files which are called gpslog.gpx, gpslog_trk.gpx, gpslog_wpt.gpx and gpslog.bin. -h Show a help text and exit. -i Ignore some error conditions and try to extract as much data as possible from GPS. -I Same as -i, but also write bad records into the GPX file. -l {on|off} Turn logging ON/OFF. -m {stop|overlap} Set STOP/OVERLAP recording method on memory full. -o log_format Enable or disable log fields (FIELD1,-FIELD2,...), available fields: UTC, VALID, LATITUDE, LONGITUDE, HEIGHT, SPEED, HEADING, DSTA, DAGE, PDOP, HDOP, VDOP, NSAT, SID, ELEVATION, AZIMUTH, SNR, RCR, MILLISECOND, DISTANCE. -p port Communication port, default: /dev/ttyUSB0. -R Recover from disabled log: erase data and reset recording criteria. -r time:distance:speed Set logging criteria (zero to disable): every 0.10-9999999.90 seconds, every 0.10-9999999.90 meters, over 0.10-9999999.90 km/h. Not all the devices support such wide ranges, more reasonable values are 1-999 seconds, 10-9999 meters and 10-999 km/h. -s speed Serial port speed, default 115200 baud. -t Create a GPX file with tracks. -v Show version information and exit. -w Create a GPX file with waypoints. -x Force reading Holux format. This is required to read-back the binary data produced by some Holux devices, which do not embed into the data itself the Holux identifier string. BUGS
Please report any bugs to Niccolo Rigacci <niccolo@rigacci.org>. LICENCE
mtkbabel is covered by the GNU General Public License (GPL), version 2 or later. AUTHORS
Niccolo Rigacci <niccolo@rigacci.org> This manual page was written by Uwe Hermann <uwe@hermann-uwe.de>. It is licensed under the terms of the GNU GPL (version 2 or later). July 30, 2011 MTKBABEL(1)
All times are GMT -4. The time now is 10:18 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy