Sponsored Content
Full Discussion: format output in csv file
Top Forums Shell Programming and Scripting format output in csv file Post 302369148 by Franklin52 on Friday 6th of November 2009 04:05:02 PM
Old 11-06-2009
Try this, suppose you want to replace the commas with spaces:

Code:
 awk 'BEGIN{printf("\"")}{gsub(","," ")}END{printf("\"")}1'  file.csv > newfile.csv

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Dynamic output file generation using a input text file with predefined output format

Hi, I have two files , one file with data file with attributes that need to be sent to another file to generate a predefined format. Example: File.txt AP|{SSHA}VEEg42CNCghUnGhCVg== APVG3|{SSHA}XK|"password" AP3|{SSHA}XK|"This is test" .... etc --------- test.sh has... (1 Reply)
Discussion started by: hudson03051nh
1 Replies

2. Shell Programming and Scripting

formatting into CSV format of SQL session output

I am getting a no of fields from a SQL session (e.g. select a,b,c from table). How do I convert the output values into CSV format . The output should be like this 'a','b','c', (4 Replies)
Discussion started by: mady135
4 Replies

3. Shell Programming and Scripting

Match list of strings in File A and compare with File B, C and write to a output file in CSV format

Hi Friends, I'm a great fan of this forum... it has helped me tone my skills in shell scripting. I have a challenge here, which I'm sure you guys would help me in achieving... File A has a list of job ids and I need to compare this with the File B (*.log) and File C (extend *.log) and copy... (6 Replies)
Discussion started by: asnandhakumar
6 Replies

4. Shell Programming and Scripting

Csv format output file using scirpt

Hi All, I get the test result file daily after running the main test script. from the resultfile, need to fetch only server info and status and put them in tabular format in a file and as well in CSV format output file. I tried using awk command but am not able to put them in tabluar... (6 Replies)
Discussion started by: Optimus81
6 Replies

5. Shell Programming and Scripting

UNIX command output in csv format

I'm just wondering is there any way to capture the output of a unix command in a csv format. df -h gives the result of filesystem,free space,Used space, use %,mounted on. Is there a way to capture the command output and format it as comma sparated or fixed length file. (3 Replies)
Discussion started by: anita81
3 Replies

6. Shell Programming and Scripting

Save output of updated csv file as csv file itself

Hi, all I want to sort a csv file based on timestamp from oldest to newest and save the output as csv file itself. Here is an example of my csv file. test.csv SourceFile,DateTimeOriginal /home/intannf/foto/IMG_0739.JPG,2015:02:17 11:32:21 /home/intannf/foto/IMG_0749.JPG,2015:02:17 11:37:28... (10 Replies)
Discussion started by: refrain
10 Replies

7. Shell Programming and Scripting

Save output of updated csv file as csv file itself, part 2

Hi, I have another problem. I want to sort another csv file by the first field. result.csv SourceFile,Airspeed,GPSLatitude,GPSLongitude,Temperature,Pressure,Altitude,Roll,Pitch,Yaw /home/intannf/foto5/2015_0313_090651_219.JPG,0.,-7.77223,110.37310,30.75,996.46,148.75,180.94,182.00,63.92 ... (2 Replies)
Discussion started by: refrain
2 Replies

8. Shell Programming and Scripting

How to parse this file using awk and output in CSV format?

My source file looks like this: Cust-Number = "101" Cust-Name="Joe" Cust-Town="London" Cust-hobby="tennis" Cust-purchase="200" Cust-Number = "102" Cust-Name="Mary" Cust-Town="Newyork" Cust-hobby="reading" Cust-purchase="125" Now I want to parse this file (leaving out hobby) and... (10 Replies)
Discussion started by: Balav
10 Replies

9. Shell Programming and Scripting

How to translate df -h output into a CSV format?

Hi, Can someone please let me know as how I can send the below df -h format of a linux system into a CSV format ? Resource Size GiB Used GiB Avail GiB Use% Cleanable GiB* ---------------- -------- -------- --------- ---- -------------- /data: pre-comp -... (10 Replies)
Discussion started by: new2prog
10 Replies

10. Programming

Python or Shell script to Grep strings from input file and output in csv format

Hi Experts, I am writing a python script to grep string from file and display output in csv file as in attached screenshot https://drive.google.com/file/d/1gfUUdfmQma33tz65NskThYDhkZUGQO0H/view Input file(result_EPFT_config_device) Below is the python script i have prepared as of... (1 Reply)
Discussion started by: as7951
1 Replies
pppstats(1M)						  System Administration Commands					      pppstats(1M)

NAME
pppstats - print PPP statistics SYNOPSIS
pppstats [-a] [-v] [-r] [-z] [-c <count>] [-w <secs>] [interface] DESCRIPTION
The pppstats utility reports PPP-related statistics at regular intervals for the specified PPP interface. If the interface is unspecified, pppstats defaults to sppp0. The display is split horizontally into input and output sections containing columns of statistics describing the properties and volume of packets received and transmitted by the interface. OPTIONS
The pppstats options are: -a Display absolute values rather than deltas. With this option, all reports show statistics for the time elapsed since the link was initiated. Without this option, the second and subsequent reports show statistics for the time since the last report. -c count Repeat the display count times. If this option is not specified, the default repeat count is 1 if the -w option is not specified, otherwise infinity. -r Display additional statistics summarizing the compression ratio achieved by the packet compression algorithm in use. -v Display additional statistics relating to the performance of the Van Jacobson TCP header compression algorithm. -w wait Pause wait seconds between each display. If this option is not specified, the default interval is five seconds. -z Instead of the standard display, show statistics indicating the performance of the packet compression algorithm in use. EXTENDED DESCRIPTION
The following fields are printed on the input side when the -z option is not used: IN Total number of bytes received by this interface. PACK Total number of packets received by this interface. VJCOMP Number of header-compressed TCP packets received by this interface. VJUNC Number of header-uncompressed TCP packets received by this interface. Not reported when the -r option is specified. VJERR Number of corrupted or bogus header-compressed TCP packets received by this interface. Not reported when the -r option is specified. VJTOSS Number of VJ header-compressed TCP packets dropped on reception by this interface because of preceding errors. Only reported when the -v option is specified. NON-VJ Total number of non-TCP packets received by this interface. Only reported when the -v option is specified. RATIO Compression ratio achieved for received packets by the packet compression scheme in use, defined as the uncompressed size divided by the compressed size. Only reported when the -r option is specified. UBYTE Total number of bytes received, after decompression of compressed packets. Only reported when the -r option is specified. The following fields are printed on the output side: OUT Total number of bytes transmitted from this interface. PACK Total number of packets transmitted from this interface. VJCOMP Number of TCP packets transmitted from this interface with VJ-compressed TCP headers. VJUNC Number of TCP packets transmitted from this interface with VJ-uncompressed TCP headers. Not reported when the -r option is specified. NON-VJ Total number of non-TCP packets transmitted from this interface. Not reported when the -r option is specified. VJSRCH Number of searches for the cached header entry for a VJ header compressed TCP packet. Only reported when the -v option is specified. VJMISS Number of failed searches for the cached header entry for a VJ header compressed TCP packet. Only reported when the -v option is specified. RATIO Compression ratio achieved for transmitted packets by the packet compression scheme in use, defined as the size before com- pression divided by the compressed size. Only reported when the -r option is specified. UBYTE Total number of bytes to be transmitted before packet compression is applied. Only reported when the -r option is speci- fied. When the -z option is specified, pppstats displays the following fields relating to the packet compression algorithm currently in use. If packet compression is not in use, these fields display zeroes. The fields displayed on the input side are: COMPRESSED BYTE Number of bytes of compressed packets received. COMPRESSED PACK Number of compressed packets received. INCOMPRESSIBLE BYTE Number of bytes of incompressible packets (that is, those which were transmitted in uncompressed form) received. INCOMPRESSIBLE PACK Number of incompressible packets received. COMP RATIO Recent compression ratio for incoming packets, defined as the uncompressed size divided by the compressed size (including both compressible and incompressible packets). The fields displayed on the output side are: COMPRESSED BYTE Number of bytes of compressed packets transmitted. COMPRESSED PACK Number of compressed packets transmitted. INCOMPRESSIBLE BYTE Number of bytes of incompressible packets received; that is, those that were transmitted by the peer in uncom- pressed form. INCOMPRESSIBLE PACK Number of incompressible packets transmitted. COMP RATIO Recent compression ratio for outgoing packets. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWpppdu | +-----------------------------+-----------------------------+ |Interface Stability |Evolving | +-----------------------------+-----------------------------+ SEE ALSO
pppd(1M), attributes(5) SunOS 5.10 4 May 2001 pppstats(1M)
All times are GMT -4. The time now is 04:58 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy