10 More Discussions You Might Find Interesting
1. UNIX for Beginners Questions & Answers
Hi,
I noticed a weird behaviour with awk.
input:
A|B|1-100|blabla_35_40_blabla;blabla_53_60_blabla;blabla_90_110_blabla
Objective:
For each string separated by ';' in $4, if the first and second numbers are included in the interval in $3, then print "TRUE". Otherwise print "FALSE".
In... (3 Replies)
Discussion started by: beca123456
3 Replies
2. Shell Programming and Scripting
looks like awk gets confused when there's a % next to a number.
command im running:
awk -F" " '/phxnaz001b/ && /vol/ && NF { if (($NF >= 80) && ($NF < 83)) { print ; print ; w++ } else if ($NF >= 83) { print ; c++ } } END { printf("%d:OK %d:WARNING %d:CRITICAL\n", o, w, c) }' /tmp/test.log
... (3 Replies)
Discussion started by: SkySmart
3 Replies
3. UNIX for Dummies Questions & Answers
Hi,
For example, I would like to insert a pipe every 4 characters for each second field (including after the last block).
input (coma separated):
line1,AAAABBBBCCCCDDDDEEEE
line2,FFFFGGGGHHHHIIIIJJJJ
output:
line1,AAAA|BBBB|CCCC|DDDD|EEEE|
line2,FFFF|GGGG|HHHH|IIII|JJJJ|
my... (2 Replies)
Discussion started by: beca123456
2 Replies
4. Shell Programming and Scripting
I have a binary (hex) file I need to parse to get some data which are encoded this way:
.* b4 . . . 01 12 .* af .* 83 L1 x1 x2 xL 84 L2 y1 y2 yL
By another words there is a stream of hexadecimal bytes (in my example separated by space for better readability). I need to get value stored in... (3 Replies)
Discussion started by: sameucho
3 Replies
5. Shell Programming and Scripting
Hi everyone !
suppose i'm searching for a specific string in a file so it is very easy, i use the following command
grep 'keyword' file_name
but how to search a word which is repeated maximum number of times in a file, for example in the following text i have to search a word which is... (12 Replies)
Discussion started by: ourned
12 Replies
6. Shell Programming and Scripting
Hi all,
I have some data in the form of
adc|nvhs|nahssn|njadnk|nkfds
in the above data i need to write a script so thet it will append "|||" to the third occurnace in the string ..... the outout should look like
adc|nvhs|nahssn||||njadnk|nkfds
Thanks,
Firestar. (6 Replies)
Discussion started by: firestar
6 Replies
7. UNIX for Dummies Questions & Answers
I need to search for a specific string in a file and if this string exist I need to replace it with something else. I am not sure how I could do this, using an if statement. (2 Replies)
Discussion started by: ROOZ
2 Replies
8. Shell Programming and Scripting
Hi,
Need to extract a string from one file and search the same in other files.
Ex:
I have file1 of hundred lines with no delimiters not even space.
I have 3 more files.
I should get 1 to 10 characters say substring from each line of file1 and search that string in rest of the files and get... (1 Reply)
Discussion started by: mohancrr
1 Replies
9. Shell Programming and Scripting
I'd like to make a script that I can execute every time I sign on to my linux box that keeps track of the time and allows to me to add a remark to a file. So basically once I log in, I run the script, and it outputs the date and time to a text file (log.txt). But that isn't my problem.
I need... (1 Reply)
Discussion started by: Glider
1 Replies
10. Shell Programming and Scripting
Dear friends,
I have one more query,
incase a file contains multiple tags of same name, then how to get the required string between the tags, in which the string begins with "O/M"
i.e., file1.txt contains following text(please note that all the following tags are in single line)... (6 Replies)
Discussion started by: swamymns
6 Replies