Visit Our UNIX and Linux User Community

Search Results

Search: Posts Made By: Perlbaby
2,916
Posted By RudiC
Redirection works identical for input as well as...
Redirection works identical for input as well as for output. Try
$ mv /tmp/new_file /tmp/old_file
$ while read product id features
do printf "${product}, %s\n" ${features%#*}
done <...
2,916
Posted By apmcd47
That is close - try this while read product id...
That is close - try this
while read product id features
do
printf "${product}, %s\n" ${features%#*}
done < Check_FileYour example was using only two variables (f1, f3) to read the fields...
2,823
Posted By RudiC
Or, awk: awk -F"[,;]+" 'NR == 1 {print; next}...
Or, awk:
awk -F"[,;]+" 'NR == 1 {print; next} {for (i=2; i<=NF; i++) print $1, " " $i}' OFS=, file
Name , Company_Worked (Header)
Asley, IBM
Asley, Amazon
Asley, BOA
Asley, Google
King.Jr,...
2,823
Posted By nezabudka
Hi How about sed? sed -r...
Hi
How about sed?
sed -r ':1;s/^([^,]+)\s*,\s*([^;]+);/\1, \2\n\1, /;t1' file
Name , Company_Worked (Header)
Asley, IBM
Asley, Amazon
Asley, BOA
Asley, Google
King.Jr, Wipro
King.Jr,...
2,823
Posted By MadeInGermany
A shell script with only shell builtins: ...
A shell script with only shell builtins:
#!/bin/sh
set -f # unquoted $f2
IFS=";"
while IFS="," read f1 f2
do
printf "$f1, %s\n" $f2
done < file
2,823
Posted By Skrynesaver
$ cat ~/tmp.dat Name , Company_Worked (Header) ...
$ cat ~/tmp.dat
Name , Company_Worked (Header)
Asley,IBM;Amazon;BOA;Google
King.Jr,Wipro;Microsoft;AMZ

$ perl -ne 'chomp;($name,$emp)=split/,/;for (split/;/,$emp){print "$name, $_\n";}'...
Forum: Programming 08-27-2018
1,235
Posted By durden_tyler
What you want are the "rank()" or "dense_rank()"...
What you want are the "rank()" or "dense_rank()" analytic functions.
They could be referred to as "window functions" or "OLAP functions" in DB2 and some of them are available in DB2 9.7 at least....
Forum: Programming 06-27-2016
5,791
Posted By durden_tyler
Over the weekend, I was able to install a very...
Over the weekend, I was able to install a very basic free, developer's edition of SAP Sybase ASE 16.0 on my Debian 8 OS.
The SQL implementation is quite primitive compared to those by the big boys....
Forum: Programming 08-02-2018
505
Posted By jgt
if I were your boss, i would calculate it this...
if I were your boss, i would calculate it this way.

SALARY=Perlbaby_annual_salary
let HOURLY_RATE = $SALARY / 2000
let ANNUAL_SAVINGS = (180 - 12) * $HOURLY_RATE
echo $ANNUAL_SAVINGS


Note...
Forum: Programming 05-05-2018
3,474
Posted By durden_tyler
The following was tested on DB2 Express-C Version...
The following was tested on DB2 Express-C Version 11.1 on a Centos 7 Virtual Machine.


[db2inst1@r2d2-centos7 data]$
[db2inst1@r2d2-centos7 data]$ cat -n dec2bin.sql
1 --
2 ...
Forum: Programming 05-16-2017
730
Posted By durden_tyler
From the ASE documentation at:...
From the ASE documentation at: infocenter.sybase.com

Adaptive Server Enterprise 15.5
> Transact-SQL User's Guide
> Using the Built-In Functions in Queries
> String functions used...
Forum: Programming 12-13-2015
1,163
Posted By jim mcnamara
Hmm that is nasty - here is a generalized...
Hmm that is nasty - here is a generalized discussion of the problem:

https://en.wikipedia.org/wiki/Correlated_subquery#Optimizing_correlated_subqueries
Forum: Programming 12-12-2015
1,163
Posted By achenle
It looks like you're doing a correlated subquery...
It looks like you're doing a correlated subquery (https://en.wikipedia.org/wiki/Correlated_subquery). Those are nasty performance killers.

Could you post the columns available in each table, the...
Forum: Programming 12-05-2012
930
Posted By Yoda
select...
select regexp_replace('AB,CD','([[:alpha:]]{2})',q'['\1']') from dual;
'AB','CD'
select regexp_replace('AB,CD,EF','([[:alpha:]]{2})',q'['\1']') from dual;
'AB','CD','EF'
Forum: Programming 12-05-2012
930
Posted By spacebar
This should work for you: select...
This should work for you:
select '''AB,CD,EF''', regexp_replace( '''AB,CD,EF''', ',', ''',''' ) from dual
1,882
Posted By black_fender
The content of the script : #!/bin/bash ...
The content of the script :

#!/bin/bash

target_date=`date +%Y%m`
cd /tmp
the_existing_file=`ls *$target_date*`
the_desired_file="Access_file_Record.${target_date}"

if [ $the_existing_file...
2,679
Posted By Corona688
UNIX doesn't use \r\n to terminate lines, just...
UNIX doesn't use \r\n to terminate lines, just \n, so the carriage return is being taken as part of the string and not as whitespace. I don't know why some systems didn't have a problem, but this is...
Forum: AIX 11-21-2011
2,236
Posted By zxmaus
Hi, there is a redbook AIX for HP System...
Hi,

there is a redbook AIX for HP System administrators (http://www.redbooks.ibm.com/abstracts/sg246767.html?Open)

Regards
zxmaus
Forum: AIX 11-21-2011
2,236
Posted By funksen
Rosetta Stone for Unix...
Rosetta Stone for Unix (http://bhami.com/rosetta.html)
Showing results 1 to 19 of 19

 

Featured Tech Videos

All times are GMT -4. The time now is 11:11 PM.
Unix & Linux Forums Content Copyright 1993-2020. All Rights Reserved.
Privacy Policy