Hi,
I am new to unix shell shell scripting. I have a specific requirement where I need to append comma's based on the max number of column in the file.
Eg:
If my source file look something like this,
sengwa,china
tom,america,northamerica
smith,america
walter
My output file... (8 Replies)
Hi,
I am trying to truncate word after comma in a file ONLY if there are already 2 words BEFORE comma. If there is one word or 3 or more words BEFORE comma, then I have to leave the data AS IS. See below for example.
Input File :
John Smith, Manager
Smith, John Frank
J F K... (2 Replies)
Hi all,
I have a text file and I need to insert comma after every 2 digit.
-1-1-1-1-1-1-1-1-1 0 0 0
-1-1-1 2 0 0 3 311-1 0 1
-1-1 021 0 011-1-1 033 0I'd like to have this:
-1,-1,-1,-1,-1,-1,-1,-1,-1, 0, 0, 0
-1,-1,-1, 2, 0, 0, 3, 3,11,-1, 0, 1
-1,-1, 0,21, 0, 0,11,-1,-1, 0,33, 0Thanks for... (7 Replies)
I am trying to search the pattern "ARS (11)" and after the LAST pattern, i am trying to open new line and enter text using sed.
My Existing Text file is Users.txtpaul, Paul Smith, Stevn Smiley, REQ000001, ARS (11)
sam, Sam Martin, Stevn Smiley, REQ000001, ARS (11)
mike, Mike Conway, Stevn... (8 Replies)
Hi all,
I have a file in which I have to insert commna between entries of 2 column and createa new file separated by commas not a columns
if input is
FHIT Adenosine Monotungstate Not Available
CS Trifluoroacetonyl Coenzyme A Not Available
Theo expected output is
... (5 Replies)
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)
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)
Hello,
I have a text file as:-ABC
BCD
CDF
DEF
EFGI need to convert as 'ABC', 'BCD', 'CDF', 'DEF', 'EFG' using a unix command
anybody can help me out on this.
Regards,
Jas
Please wrap all code, files, input & output/errors in CODE tags.
It makes them easier to read and preserves... (12 Replies)
Hi All,
I have a file which has data like
a,b
c,d
e,f
g,h
And I need to insert a new column at the begining with sequence no( 1 to n)
1,a,b
2,c,d
3,e,f
4,g,h
Please let me know how to acheive this in unix (3 Replies)
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
LEARN ABOUT DEBIAN
gnc-fq-helper
GNC-FQ-HELPER(1) User Contributed Perl Documentation GNC-FQ-HELPER(1)NAME
gnc-fq-helper - allows gnucash to communicate with Finance::Quote
over pipes from guile. The requests and responses
are scheme forms.
SYNOPSIS
gnc-fq-helper
DESCRIPTION
Input: (on standard input - one entry per line and one line per entry, and double quotes must only be delimiters, not string content --
remember, we don't have a real scheme parser on the perl side :>).
(<method-name> symbol symbol symbol ...)
where <method-name> indicates the desired Finance::Quote method. The currently recognized subset is yahoo, yahoo_europe, fidelity_direct,
troweprice_direct, vanguard, asx, tiaacref, and currency.
For currency quotes, the symbols alternate between the 'from' and 'to' currencies.
For example:
(yahoo "IBM" "LNUX") (fidelity_direct "FBIOX" "FSELX") (currency "USD" "AUD")
Output (on standard output, one output form per input line):
Schemified version of gnc-fq's output, basically an alist of alists, as in the example below. Right now, only the fields that this script
knows about (and knows how to convert to scheme) are returned, so the conversion function will have to be updated whenever Finance::Quote
changes. Currently you'll get symbol, gnc:time-no-zone, and currency, and either last, nav, or price. Fields with gnc: prefixes are
non-Finance::Quote fields. gnc:time-no-zone is returned as a string of the form "YYYY-MM-DD HH:MM:SS", basically the unmolested (and
underspecified) output of the quote source. It's up to you to know what it's proper timezone really is. i.e. if you know the time was in
America/Chicago, you'll need to convert it to that.
For example:
$ echo '(yahoo "CSCO" "JDSU" "^IXIC")' | ./gnc-fq-helper
(("CSCO" (symbol . "CSCO")
(gnc:time-no-zone . "2001-03-13 19:27:00")
(last . 20.375)
(currency . "USD"))
("JDSU" (symbol . "JDSU")
(gnc:time-no-zone . "2001-03-13 19:27:00")
(last . 23.5625)
(currency . "USD"))
("^IXIC" (symbol . ^IXIC)
(gnc:time-no-zone . 2002-12-04 17:16:00)
(last . 1430.35)
(currency . failed-conversion)))
On error, the overall result may be #f, or on individual errors, the list sub-item for a given symbol may be #f, like this:
$ echo '(yahoo "CSCO" "JDSU")' | ./gnc-fq-helper
(#f
("JDSU" (symbol . "JDSU")
(gnc:time-no-zone . "2001-03-13 19:27:00")
(last . 23.5625)
(currency . "USD")))
further, errors may be stored with each quote as indicated in Finance::Quote, and whenever the conversion to scheme data fails, the field
will have the value 'failed-conversion, and accordingly this symbol will never be a legitimate conversion.
Exit status
0 - success non-zero - failure
perl v5.14.2 2013-01-03 GNC-FQ-HELPER(1)