Sponsored Content
Full Discussion: Help with data formatting
Top Forums Shell Programming and Scripting Help with data formatting Post 302761605 by RudiC on Saturday 26th of January 2013 05:56:35 AM
Old 01-26-2013
Don't know how I spoiled that: append a } to the line NR>1...
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Formatting Data

i am writing a script that reads in a file and i just want it to print each element on a new line here is my code and the data that i want to read in #!/usr/bin/perl use strict; use CGI qw(:standard); use CGI qw(:cgi); my $data_file = "/tmp/results.txt"; my $configuration; my... (3 Replies)
Discussion started by: nmeliasp
3 Replies

2. Shell Programming and Scripting

Re-formatting of data display

Hi All, I have been trying to re-arrange the below data using AWK or Perl. Can anybody help me ? Thanks in advance. Input: 111 222 333 444 AAA BBB CCC DDD 555 666 777 888 EEE FFF GGG HHH Output: (6 Replies)
Discussion started by: Raynon
6 Replies

3. Shell Programming and Scripting

Script for data formatting

Hi I have to convert the data in a file ******* 01-20-09 11:14AM 60928 ABC Valuation-2009.xls 01-20-09 11:16AM 55808 DEF GHI Equation-2009.xls 01-20-09 11:02AM 52736 ABC DF Valuation-2009.xls 01-20-09 11:06AM 89600 THE... (6 Replies)
Discussion started by: shekhar_v4
6 Replies

4. UNIX for Dummies Questions & Answers

Data manipulation/ formatting question

How would I get this output to look $ cat newfile 13114 84652 84148 LIKE THIS?: 13114,84652,84148 sed,cut awk? syntax? (2 Replies)
Discussion started by: ddurden7
2 Replies

5. Shell Programming and Scripting

Formatting Data - CSV

I want to check whether if any column data has any + , - , = prefixed to it then convert it in such a form that in excel its not read as formula. echo "$DATA" | awk 'BEGIN { OFS="," } -F" " {print $1,$2,$3,$4,$5,$6,$7,$8.$9,$10,$11,$12}' (4 Replies)
Discussion started by: dinjo_jo
4 Replies

6. Shell Programming and Scripting

Formatting input data

Hello everybody, I have a file containing some statistics regarding CPU usage. The file has this syntax : Fri Jul 16 14:27:16 EEST 2010 Cpu(s): 15.2%us, 1.4%sy, 0.0%ni, 82.3%id, 0.1%wa, 0.0%hi, 0.9%si, 0.0%st Fri Jul 16 15:02:17 EEST 2010 Cpu(s): 15.3%us, 1.4%sy, 0.0%ni, 82.3%id, ... (9 Replies)
Discussion started by: spiriad
9 Replies

7. Shell Programming and Scripting

help with data formatting

Hi, I have data coming in like below. Not all data is like that, these are the problem records that is causing the ETL load to fail. Can you pls help me with combining theese broken records! 001800018000000guyMMAAY~acct name~acct type~~"address part 1 address... (8 Replies)
Discussion started by: varman
8 Replies

8. UNIX for Advanced & Expert Users

formatting the data

HI I want to make it single row if start with braces i.e. { .Any idea {1:XXX2460275191}{2:SEC00687921131112201641N}{3:{58910}}{4: :R:GENL :C::xx//xx1 :20C::yy//yy1 :2S:xxT} {1:XXX2460275190}{2:SEC00687921131112201641y}{3:{58911}}{4: :z:GENL :v::xx//xx1 :10C::yy//yy1 :4S:xxT ... (2 Replies)
Discussion started by: mohan705
2 Replies

9. Shell Programming and Scripting

Data formatting using awk

Need assistance on the data extraction using awk Below is the format and would like to extract the data in another format ------------------------------------------------------------------------------------------------- Minimum Temperature (deg F ) DAY 1 2 3 4 5 6 7 8 9 10 11... (4 Replies)
Discussion started by: ajayram_arya
4 Replies
G_GEOM(9)						   BSD Kernel Developer's Manual						 G_GEOM(9)

NAME
g_new_geomf, g_destroy_geom -- geom management SYNOPSIS
#include <geom/geom.h> struct g_geom * g_new_geomf(struct g_class *mp, const char *fmt, ...); void g_destroy_geom(struct g_geom *gp); DESCRIPTION
The geom (do not confuse ``geom'' with ``GEOM'') is an instance of a GEOM class. For example: in a typical i386 FreeBSD system, there will be one geom of class MBR for each disk. The geom's name is not really important, it is only used in the XML dump and for debugging purposes. There can be many geoms with the same name. The g_new_geomf() function creates a new geom, which will be an instance of the class mp. The geom's name is created in a printf(3)-like way from the rest of the arguments. The g_destroy_geom() function destroys the given geom immediately and cancels all related pending events. The g_geom structure contains fields that should be set by the caller after geom creation, but before creating any providers or consumers related to this geom (not all are required): g_start_t * start Pointer to a function used for I/O processing. g_spoiled_t * spoiled Pointer to a function used for consumers spoiling. g_dumpconf_t * dumpconf Pointer to a function used for configuration in XML format dumping. g_access_t * access Pointer to a function used for access control. g_orphan_t * orphan Pointer to a function used to inform about orphaned consumer. g_ioctl_t * ioctl Pointer to a function used for handling ioctl requests. void * softc Field for private use. RESTRICTIONS
/CONDITIONS If you intend to use providers in this geom you must set field start of your geom. If you are planning to use consumers in your geom you must set fields orphan and access for it. g_new_geomf(): Class mp must be valid (registered in GEOM). The topology lock has to be held. g_destroy_geom(): The geom cannot posses any providers. The geom cannot posses any consumers. The topology lock has to be held. RETURN VALUES
The g_new_geomf() function returns a pointer to the newly created geom. EXAMPLES
Create an example geom. static struct geom * g_example_start(struct bio *bp) { [...] } static void g_example_orphan(struct g_consumer *cp) { g_topology_assert(); [...] } static void g_example_spoiled(struct g_consumer *cp) { g_topology_assert(); [...] } static void g_example_access(struct g_provider *pp, int dr, int dw, int de) { [...] } static struct g_geom * create_example_geom(struct g_class *myclass) { struct g_geom *gp; g_topology_lock(); gp = g_new_geomf(myclass, "example_geom"); g_topology_unlock(); gp->start = g_example_start; gp->orphan = g_example_orphan; gp->spoiled = g_example_spoiled; gp->access = g_example_access; gp->softc = NULL; return (gp); } static int destroy_example_geom(struct g_geom *gp) { g_topology_lock(); if (!LIST_EMPTY(&gp->provider) || !LIST_EMPTY(&gp->consumer)) { g_topology_unlock(); return (EBUSY); } g_destroy_geom(gp); g_topology_unlock(); return (0); } SEE ALSO
geom(4), DECLARE_GEOM_CLASS(9), g_access(9), g_attach(9), g_bio(9), g_consumer(9), g_data(9), g_event(9), g_provider(9), g_provider_by_name(9), g_wither_geom(9) AUTHORS
This manual page was written by Pawel Jakub Dawidek <pjd@FreeBSD.org>. BSD
January 16, 2004 BSD
All times are GMT -4. The time now is 05:56 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy