Search Results

Search: Posts Made By: balajesuri
197
Posted By balajesuri
Of course with -F flag: awk -F, '!a[$1]++' file
Of course with -F flag:
awk -F, '!a[$1]++' file
Forum: What is on Your Mind? 4 Weeks Ago
1,085
Posted By balajesuri
Way to go Ravinder and Victor! You deserve it :)
Way to go Ravinder and Victor! You deserve it :)
Forum: What is on Your Mind? 12-26-2019
1,176
Posted By balajesuri
...and learned a lot along the way :) Thanks for...
...and learned a lot along the way :) Thanks for the efforts.
928
Posted By balajesuri
1/ The first thing I observed is that you're...
1/
The first thing I observed is that you're doing
for var in `cat filename`
do
...
done
instead of
while read line
do
...
done < filename



2/
Next I see that in the inner loop...
952
Posted By balajesuri
Why not use awks' own printf? - Printf Examples...
Why not use awks' own printf? - Printf Examples (The GNU Awk User’s Guide) (https://www.gnu.org/software/gawk/manual/html_node/Printf-Examples.html)
Forum: Programming 11-04-2019
1,182
Posted By balajesuri
Since you're using python3, you can also take...
Since you're using python3, you can also take advantage of string formatting:


'https://www.meihoski.co.jp/movie/{}'.format(a['href'])

Check this out: 6.1. string — Common string operations —...
Forum: Programming 09-05-2019
6,172
Posted By balajesuri
Minor edit
1. Read the file "SHA256" line by line in a loop. (for line in filehandle)

2. Tokenise each line as you read - the result will be stored in a list (hint: split after you strip)

3. The last item...
381
Posted By balajesuri
I think OP is asking for side by side printing of...
I think OP is asking for side by side printing of the output of two python scripts as they run, and has shown as an example, concatenation of two text files using izip_longest().


@bigvito19...
2,648
Posted By balajesuri
On GNU bash, version 4.4.12 $ echo...
On GNU bash, version 4.4.12



$ echo ${text:1:-1}
001E:001F,,,02EE,0FED:0FEF
1,463
Posted By balajesuri
1. Could you please show what you have tried? ...
1. Could you please show what you have tried?

2. Please understand that forum members may not have working knowledge of biology. So when you say, "Print out the number of occurrences for each...
1,349
Posted By balajesuri
| sed 's/\(\([0-9A-F][0-9A-F] \)\{4\}\)/\1\n/g'
| sed 's/\(\([0-9A-F][0-9A-F] \)\{4\}\)/\1\n/g'
1,282
Posted By balajesuri
grep -P -B 10 -A 9 'Status: ...
grep -P -B 10 -A 9 'Status: (?!Clear)' alarm.txt
Forum: Programming 07-25-2019
1,393
Posted By balajesuri
A more pythonic way ;) N =...
A more pythonic way ;)



N = int(input("Please enter number:"))
t = sum([int(input("Enter Numbers %d:" %i)) for i in range(1, N+1)])
print(t)
232
Posted By balajesuri
I think your set -x gives pretty clear idea that...
I think your set -x gives pretty clear idea that "srvctl config database...." is not having any output. So $STANDBY_CONF is empty.
May be you want to check by running this command directly on...
2,732
Posted By balajesuri
Best place to start is the AWK manual: The GNU...
Best place to start is the AWK manual: The GNU Awk User’s Guide (https://www.gnu.org/software/gawk/manual/gawk.html)
Then you need lot of patience, practice, reading forums like this one and think...
Forum: Programming 02-15-2019
909
Posted By balajesuri
You might want to start by reading the JAVA API...
You might want to start by reading the JAVA API documentation of File class:
File (Java Platform SE 7 ) (https://docs.oracle.com/javase/7/docs/api/java/io/File.html)
270
Posted By balajesuri
Few simple modifications: #!/bin/bash ...
Few simple modifications:



#!/bin/bash

VarSize=${1-5} # use $1 if defined, else set VarSize as 5
OptSize=${2-3} # use $2 if defined, else set OptSize as 3
HomeSize=${3-2} # use $3 if...
685
Posted By balajesuri
Or an interesting exercise would be to convert...
Or an interesting exercise would be to convert your script to run on bourne shell, so that it works on all shells. Would be quite insightful to do so :)
704
Posted By balajesuri
Do you have this module IO::Tty...
Do you have this module IO::Tty (https://metacpan.org/pod/IO::Tty) installed?
253
Posted By balajesuri
This looks like a config file (or ini file) that...
This looks like a config file (or ini file) that can be read by python's configparser module. Here's an attempt to comment out a section using python 3 interpreter.


import configparser

file =...
653
Posted By balajesuri
As per the OSX sed manual...
As per the OSX sed manual (https://ss64.com/osx/sed.html) (and the error message), you need to use a backslash and newline for a, i and c:
[1addr]i\
text
Write text to the...
390
Posted By balajesuri
Hello, what have you tried? :-) Here are...
Hello, what have you tried? :-)

Here are some pointers to help you get started:
1. ls -rt | tail -1 to get the last image.
2. Check if it's an image file (and not a dir or symlink, for instance)...
884
Posted By balajesuri
You can create a virtual stack in your mind and...
You can create a virtual stack in your mind and then read through the code. Everytime there's an if, you make a push; and everytime there's a fi, you make a pop from that virtual stack. At the end of...
Forum: Programming 03-09-2018
1,093
Posted By balajesuri
In a class, if you declare a method as static,...
In a class, if you declare a method as static, you need not instantiate the class to be able to use the method. So , in your program, the method change() is being called directly by qualifying it...
526
Posted By balajesuri
It could also be a good start to learn python...
It could also be a good start to learn python programming language and explore numpy (http://www.numpy.org/).
Showing results 1 to 25 of 500

 

Featured Tech Videos

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