Search Results

Search: Posts Made By: bobbygsk
1,201
Posted By bakunin
Ignoring the line numbers is OK, but right now...
Ignoring the line numbers is OK, but right now there is a number, then a colon and then a space. Only then the text begins. I am not sure if the space is in your data or not, but suppose it isn't. If...
1,201
Posted By Scrutinizer
Note: it is best to escape the / inside the...
Note: it is best to escape the / inside the square bracket expression when used inside a regex constant, to prevent it from being confused with the closing / of the regex constant. Some awks cannot...
1,201
Posted By vgersh99
how about: awk '/[/]...
how about:

awk '/[/] ---/,/insert_job/;/max_run_alarm/{print $0 ORS}' myFile
3,115
Posted By drl
Hi, bobbygsk . It's always useful to tell us...
Hi, bobbygsk .

It's always useful to tell us your OS and shell. As Aia pointed out, there are differences in command rename depending on the distribution.

If you still need advice, perhaps one...
3,115
Posted By MadeInGermany
To avoid a "files are identical" error better...
To avoid a "files are identical" error better ensure that the source file has a : character
for FN in *2017*.csv_*:*; do ...BTW the // modifier works in bash and zsh and ksh93.
3,115
Posted By RudiC
Try for FN in *2017*.csv_*; do echo mv "$FN"...
Try
for FN in *2017*.csv_*; do echo mv "$FN" "${FN//:/-}"; done
mv Instruments_20171004.csv_11-03-2017_20:01:06.gz Instruments_20171004.csv_11-03-2017_20-01-06.gz
mv...
3,115
Posted By Aia
You must be using the rename utility normally...
You must be using the rename utility normally provided by the util-linux-ng. The command you are using might work for the Perl script with the same name.

Alternatively, this might be of value:
ls...
2,040
Posted By RavinderSingh13
Hello bobbygsk, Your Input_file was NOT TAB...
Hello bobbygsk,

Your Input_file was NOT TAB delimited, so I made it as tab delimited and tried my command and it is working fine only.

cat Input_file
ABBR DESC COL3 COL4 ...
2,040
Posted By vgersh99
should have mentioned the field separator in the...
should have mentioned the field separator in the beginning...
try this:

awk -F'\t' '
FNR>1 && NF{
if ($1)
miss=$1 OFS $2
else
$0=(miss OFS $(NF-3) OFS $(NF-2) OFS...
4,003
Posted By Don Cragun
OK. Unfortunately, you can't count how many...
OK. Unfortunately, you can't count how many lines you have written into a file before you write those lines into the file. So using cntRec like you tried can only show you how many lines were...
4,003
Posted By Don Cragun
When you use the *printf() family of functions...
When you use the *printf() family of functions and you want to print a percent sign (%) rather than have it act as a format field introducing character, you need to use %% as in:
cmd = sprintf("date...
4,003
Posted By Don Cragun
If you don't have GNU awk (or if you want code...
If you don't have GNU awk (or if you want code that should work on any system), you could try something like:
#!/bin/ksh
lc=$(wc -l < split.txt)
awk -v lc="$lc" '
BEGIN { lpf = 1000000 # Lines...
4,003
Posted By CarloM
That section executes for every line (as the...
That section executes for every line (as the comment says) - you would probably want the header in a (new) NR%100000==1 section and the trailer in the NR%100000==0 section before the close. You'd...
4,003
Posted By Don Cragun
Since you're specifying 3 digit file sequence...
Since you're specifying 3 digit file sequence numbers, I assume you expect that you'll be producing more than a hundred files with this script. There is a good chance that awk will run out of file...
4,003
Posted By MadeInGermany
sprintf prints to a string. ...
sprintf prints to a string.
filename=sprintf("split.%03d.txt",(NR-1)/2)
2,721
Posted By in2nix4life
I have this implemented on the Sarbox systems...
I have this implemented on the Sarbox systems under my charge.

Add the following to the global profile (/etc/profile):


TMOUT=300 # time in seconds to expire the connection
readonly...
2,721
Posted By bitlord
You could in the future have your terminal time...
You could in the future have your terminal time out after lets say 20min of inactivity and the server would log him off. This way you will not have to do anything.
2,721
Posted By RudiC
You are not going to his cube. You log in to the...
You are not going to his cube. You log in to the target system, and then look for the PID of his session, and kill that.
Or, why don't you ask him to close it from his PC?
26,635
Posted By Corona688
Well they're in YYYYMMDD order already which is...
Well they're in YYYYMMDD order already which is convenient.

We tell it to split fields on . then sort on characters 1 through 15 of the third field.

sort -t. -k 3.1,3.15 < infile > outfile
4,344
Posted By Yoda
Set escape to ON and try: Out=$(sqlplus -s...
Set escape to ON and try:
Out=$(sqlplus -s xxxx/xxxx@xxxx <<EOF
set pagesize 0 LINESIZE 1000 feedback off verify off heading off echo off escape on
select count(1) from dual where dummy = \'X\';...
5,991
Posted By cjcox
Or use a mail to sms gateway, see...
Or use a mail to sms gateway, see https://en.wikipedia.org/wiki/List_of_SMS_gateways
4,526
Posted By Corona688
Which makes little difference in a usual regex,...
Which makes little difference in a usual regex, being that sed removes newlines before doing regex matching..
4,526
Posted By Yoda
Actually character class [:blank:] matches spaces...
Actually character class [:blank:] matches spaces and tabs.

Character class [:space:] matches spaces and tabs as well as newline, vertical tab, form feed, carriage return.

For further...
4,526
Posted By Corona688
[[:space:]] means any whitespace, so it matches...
[[:space:]] means any whitespace, so it matches tabs as well as spaces.
5,587
Posted By bakunin
Then your input is different from the example you...
Then your input is different from the example you gave, which doesn't have absolute paths at all ("find . ..."). I suggest you consult the man page of "ksh" or "bash" about "variable expansion" and...
Showing results 1 to 25 of 36

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