Search Results

Search: Posts Made By: mkastin
1,666
Posted By mkastin
Split, Search and Reformat by Data Group
Hi,

I am writing just to share my appreciation for help I have received from this site in the past.

In a previous post Split File by Data Group...
2,749
Posted By mkastin
Many thanks Alister. Your guess about the...
Many thanks Alister.

Your guess about the units is correct.

These files are actually excerpts for the USDA Nutrient Database available here:

http://www.nal.usda.gov/fnic/foodcomp/search/
2,749
Posted By mkastin
Merge Multiple Files and Transpose
Looking to join three files and then transpose some columns from multiple rows into a single row.


File Info:

FIELD TERMINATED BY '^'
ENCLOSED BY '~'
LINE TERMINATED BY '\r\n'



FIRST...
5,665
Posted By mkastin
Thanks that worked well.
Thanks that worked well.
5,665
Posted By mkastin
Defining Dynamic Number of Variables in a Bash Script
Code:

$ cat test.bash
#!/bin/bash

job=$1
steps=$2

num=$(echo "$@" | wc -w)



Example Submission:


$ ./test.bash BS01 3 1 2 3



What:
10,051
Posted By mkastin
sysstat
sysstat
2,849
Posted By mkastin
man, why must I always do things in the strangest...
man, why must I always do things in the strangest of ways....
10,051
Posted By mkastin
This will assign user cpu% used to variable c ...
This will assign user cpu% used to variable c

This assumes, you only have 1 cpu and that you are only concerned with user cpu %

c=`iostat | awk '{if(NR==4) {print $1}}'`
20,523
Posted By mkastin
If you just want to use "oracle" you wouldn't...
If you just want to use "oracle" you wouldn't need a script like this...


$ cat ./bin/df.bash
#!/bin/bash

echo Please type Filesystem Name:

read fs

rs=`df -h | awk -v fs=$fs 'BEGIN...
2,849
Posted By mkastin
just a start.... $ cat spell_game ...
just a start....

$ cat spell_game
#!/bin/bash

matches=`awk '
(/^ball/ || /ball$/) && !(/^ball$/||/s$/||/ing$/||/ed$/||/er$/) {
gsub(/ball/,"")
if(length($0)>1) {print $0}
$0=""
}
...
9,291
Posted By mkastin
what was the exact code you submitted during that...
what was the exact code you submitted during that run please
5,130
Posted By mkastin
$ echo "secret1 secret2 serect3" | awk 'BEGIN...
$ echo "secret1 secret2 serect3" | awk 'BEGIN {RS=" "; ORS=" "} {key=substr($1,length($1)); print key}'

This should return whatever is in the last space of each string...
9,291
Posted By mkastin
Try doing a bulk insert instead. I didn't test...
Try doing a bulk insert instead. I didn't test this....


BULK INSERT my_table_tmp
FROM '"{$input}"'
WITH (fieldterminator = ',' ,roterminator = '\n')
10,504
Posted By mkastin
http://www.linuxtutorialblog.com/post/tutorial-con...
http://www.linuxtutorialblog.com/post/tutorial-conditions-in-bash-scripting-if-statements
1,717
Posted By mkastin
input $ cat vtest Vouchers For Date...
input
$ cat vtest
Vouchers For Date :05/01/2009 *...
1,717
Posted By mkastin
Can you please provide an example of exactly how...
Can you please provide an example of exactly how you want the output to look. Thanks.
5,130
Posted By mkastin
Please provide a better example of input and...
Please provide a better example of input and output that you are looking for.
5,130
Posted By mkastin
Try using gawk or nawk instead of awk. You may...
Try using gawk or nawk instead of awk. You may have to install them and I would recommend doing that if you're able.


or

use sed


echo "secret1 secret2 secret3" | sed 's/[a-z]//g'
5,130
Posted By mkastin
$ echo "secret1 secret2 serect3" | awk...
$ echo "secret1 secret2 serect3" | awk '{gsub(/[a-z]/,""); print $0}'
1 2 3
10,378
Posted By mkastin
There are three standard sources of input and...
There are three standard sources of input and output for a program. Standard input usually comes from the keyboard if it’s an interactive program, or from another program if it’s processing the other...
4,645
Posted By mkastin
Okay, finally got back to finishing this off, I...
Okay, finally got back to finishing this off, I hacked it up pretty ugly but it works as intended so here it goes...

Example Input:

$ cat ./scripts/tests/beers.dat
1. LIGHT LAGER
1A. Lite...
4,645
Posted By mkastin
I will be able to this evening, I will have to...
I will be able to this evening, I will have to make a few modifications to the script and won't have access to my servers till later today.
4,645
Posted By mkastin
Definitely, thank you very much for your help...
Definitely, thank you very much for your help with this, much appreciated!

Thanks!
4,645
Posted By mkastin
Split file by data group
Hi all,

I'm having a little trouble solving a file split I need to get done.

I have the following data:



1. Light
1A. Light Soft
texture: it's soft
color: the color value is that of...
7,846
Posted By mkastin
for file in `ls -ltr --time-style=+%s | awk...
for file in `ls -ltr --time-style=+%s | awk '{now=systime(); del_time=now-2; if($6<del_time && $5=="0") print $7}'` ;do
chmod 777 $file >/dev/null 2>&1
rm -f $file >/dev/null 2>&1
done
Showing results 1 to 25 of 52

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