Sponsored Content
Full Discussion: insert comma in a text file
Top Forums UNIX for Dummies Questions & Answers insert comma in a text file Post 302480607 by radoulov on Wednesday 15th of December 2010 10:38:59 AM
Old 12-15-2010
Could you please explain why: 0,21, and not 021,?
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Parsing comma delimited text file

I need to delete a set of files in certain directories if there're older than a certain number of days. So I have a text file, with each line containing the directory & number of days. The format is like this: dirA,5 dirB,7 How do I write script to iteratively parse this text file & delete... (5 Replies)
Discussion started by: chengwei
5 Replies

2. Shell Programming and Scripting

How do you delete multiple text from a comma delimited file

I would like to know code that will delete multiple text from a comma delimited file. For example, how would the comma delimited file below delete the word 'PEST' in Perl language (previously an excel file that was converted to a csv and the last column was PEST): 1, 2,43,34, bosx,PEST 1,... (1 Reply)
Discussion started by: dolo21taf
1 Replies

3. Shell Programming and Scripting

How to replace all entries of comma in text file by space or other character

Hi , How to replace all entries of comma in text file by space or other character. cat temp.txt A,B,C,D I want this file to be like A B C D Please help!!! (4 Replies)
Discussion started by: prashant43
4 Replies

4. Shell Programming and Scripting

How to insert some constant text at beginig of each line within a text file.

Dear Folks :), I am new to UNIX scripting and I do not know how can I insert some text in the first column of a UNIX text file at command promtp. I can do this in vi editor by using this command :g/^/s//BBB_ e,g I have a file named as Test.dat and it containins below text: michal... (4 Replies)
Discussion started by: Muhammad Afzal
4 Replies

5. Shell Programming and Scripting

Need to insert new text and change existing text in a file using SED

Hi all, I need to insert new text and change existing text in a file. For that I used the below line in the command line and got the expected output. sed '$a\ hi... ' shell > shell1 But I face problem when using the same in script. It is throwing the error as, sed: command garbled:... (4 Replies)
Discussion started by: iamgeethuj
4 Replies

6. Shell Programming and Scripting

Convert comma text file to Column in html format

I am trying to generate a report with below file : File1 : EQADM,edrtere9-phys,8122caef0,gpatmon,/bin/ksh,nuten Erick EQADM,edrtere11-phys,8227caef0,gpatmon,/bin/ksh,nuten Erick EQADM,edrtere3-phys,822caef0,gpatmon,/bin/ksh,nuten Erick can you help me convert it to html and add... (9 Replies)
Discussion started by: sriram003
9 Replies

7. Shell Programming and Scripting

How to format file into comma separated text file?

Hi Guys, I have text file which is tab/space separated but I want it to re-format into a comma separated and trim the spaces in between. Can someone spare me a perl or sed script that can do the job? INPUT FILE: 500010245623 500 21-APR-11 05.58.21 PM ... (14 Replies)
Discussion started by: pinpe
14 Replies

8. Shell Programming and Scripting

Append the text file with comma at the end of every word

Hi folks, Using shell, I am trying the append comma to every line of text. the requirement is like, I have to open the txt file in unix and read line by line and should add comma at the end of every word to make it single line txt file ------- abc@gmail.com bcd@gmail.com... (7 Replies)
Discussion started by: giridhar276
7 Replies

9. UNIX for Dummies Questions & Answers

insert comma

my file looks like this: 297 PC Closed 07/10/12 999000098 AMERICAN SOCIETY FOR HEALTHCAR 0.00 USD 1 NAI i want to look line this: 297,PC,Closed,07/10/12,999000098,AMERICAN SOCIETY FOR HEALTHCAR,0.00,USD,1,NAI (4 Replies)
Discussion started by: lawsongeek
4 Replies

10. Shell Programming and Scripting

Insert data between comma delimiters-large file

Having a huge file in the following format. 2,3,1,,,4 1,2,3,,,,,5, 8,7,3,4,,,, Output needed is: 2,3,1,0.0,0.0,4 1,2,3,0.0,0.0,0.0,0.0,5, 8,7,3,4,0.0,0.0,0.0, I have tried reading the file each line, using AWK to parse to find out ",," and then insert 0.0 . It works but very slow. Need... (8 Replies)
Discussion started by: wincrazy
8 Replies
Glib::version(3)					User Contributed Perl Documentation					  Glib::version(3)

NAME
Glib::version - Library Versioning Utilities SYNOPSIS
# require at least version 1.021 of the Glib module use Glib '1.021'; # g_set_application_name() was introduced in GLib 2.2.0, and # first supported by version 1.040 of the Glib Perl module. if ($Glib::VERSION >= 1.040 and Glib->CHECK_VERSION (2,2,0)) { Glib::set_application_name ('My Cool Program'); } DESCRIPTION
Both the Glib module and the GLib C library are works-in-progress, and their interfaces grow over time. As more features are added to each, and your code uses those new features, you will introduce version-specific dependencies, and naturally, you'll want to be able to code around them. Enter the versioning API. For simple Perl modules, a single version number is sufficient; however, Glib is a binding to another software library, and this introduces some complexity. We have three versions that fully specify the API available to you. Perl Bindings Version Perl modules use a version number, and Glib is no exception. $Glib::VERSION is the version of the current Glib module. By ad hoc convention, gtk2-perl modules generally use version numbers in the form x.yyz, where even yy values denote stable releases and z is a patchlevel. $Glib::VERSION use Glib 1.040; # require at least version 1.040 Compile-time ("Bound") Library Version This is the version of the GLib C library that was available when the Perl module was compiled and installed. These version constants are equivalent to the version macros provided in the GLib C headers. GLib uses a major.minor.micro convention, where even minor versions are stable. (gtk2-perl does not officially support unstable versions.) Glib::MAJOR_VERSION Glib::MINOR_VERSION Glib::MICRO_VERSION Glib->CHECK_VERSION($maj,$min,$mic) Run-time ("Linked") Library Version This is the version of the GLib C library that is available at run time; it may be newer than the compile-time version, but should never be older. These are equivalent to the version variables exported by the GLib C library. Glib::major_version Glib::minor_version Glib::micro_version Which one do I use when? Where do you use which version? It depends entirely on what you're doing. Let's explain by example: o Use the Perl module version for bindings support issues You need to register a new enum for use as the type of an object property. This is something you can do with all versions of the underlying C library, but which wasn't supported in the Glib Perl module until $Glib::VERSION >= 1.040. o Use the bound version for library features You want to call Glib::set_application_name to set a human-readable name for your application (which is used by various parts of Gtk2 and Gnome2). g_set_application_name() (the underlying C function) was added in version 2.2.0 of glib, and support for it was introduced into the Glib Perl module in Glib version 1.040. However, you can build the Perl module against any stable 2.x.x version of glib, so you might not have that function available even if your Glib module is new enough! Thus, you need to check two things to see if the this function is available: if ($Glib::VERSION >= 1.040 && Glib->CHECK_VERSION (2,2,0)) { # it's available, and we can call it! Glib::set_application_name ('My Cool Application'); } Now what happens if you installed the Perl module when your system had glib 2.0.6, and you upgraded glib to 2.4.1? Wouldn't g_set_application_name() be available? Well, it's there, under the hood, but the bindings were compiled when it wasn't there, so you won't be able to call it! That's why we check the "bound" or compile-time version. By the way, to enable support for the new function, you'd need to reinstall (or upgrade) the Perl module. o Use the linked version for runtime work-arounds Suppose there's a function whose API did not change, but whose implementation had a bug in one version that was fixed in another version. To determine whether you need to apply a workaround, you would check the version that is actually being used at runtime. if (Glib::major_version == 2 && Glib::minor_version == 2 && Glib::micro_version == 1) { # work around bug that exists only in glib 2.2.1. } In practice, such situations are very rare. METHODS
boolean = Glib->CHECK_VERSION ($required_major, $required_minor, $required_micro) o $required_major (integer) o $required_minor (integer) o $required_micro (integer) Provides a mechanism for checking the version information that Glib was compiled against. Essentially equvilent to the macro GLIB_CHECK_VERSION. (MAJOR, MINOR, MICRO) = Glib->GET_VERSION_INFO Shorthand to fetch as a list the glib version for which Glib was compiled. See "Glib::MAJOR_VERSION", etc. integer = Glib::MAJOR_VERSION Provides access to the version information that Glib was compiled against. Essentially equivalent to the #define's GLIB_MAJOR_VERSION. integer = Glib::MICRO_VERSION Provides access to the version information that Glib was compiled against. Essentially equivalent to the #define's GLIB_MICRO_VERSION. integer = Glib::MINOR_VERSION Provides access to the version information that Glib was compiled against. Essentially equivalent to the #define's GLIB_MINOR_VERSION. integer = Glib::major_version Provides access to the version information that Glib is linked against. Essentially equivalent to the global variable glib_major_version. integer = Glib::micro_version Provides access to the version information that Glib is linked against. Essentially equivalent to the global variable glib_micro_version. integer = Glib::minor_version Provides access to the version information that Glib is linked against. Essentially equivalent to the global variable glib_minor_version. SEE ALSO
Glib COPYRIGHT
Copyright (C) 2003-2009 by the gtk2-perl team. This software is licensed under the LGPL. See Glib for a full notice. perl v5.12.1 2010-07-05 Glib::version(3)
All times are GMT -4. The time now is 03:49 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy