10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi folks,
I have a scenario to convert the update statements into insert statements using shell script (awk, sed...) or in database using regex.
I have a bunch of update statements with all columns in a file which I need to convert into insert statements.
UPDATE TABLE_A SET COL1=1 WHERE... (0 Replies)
Discussion started by: dev123
0 Replies
2. Shell Programming and Scripting
awk '{a=$0} END {while (NR) print a}' mail.log | awk '/Feb 2/ {print ;exit;}'
first, can this code be combined into one?
what i want this code to do is output every single line it finds up until the last occurrence of "Feb 2".
right now, this code simply outputs one line, and aborts. ... (12 Replies)
Discussion started by: SkySmart
12 Replies
3. Shell Programming and Scripting
ignore the simplicity of the foo file, my actual file is much more hardcore but this should give you the jist of it. need to combine the two awks into one liner. essentially, need to return the value of one particular field in a file that has multiple comma separated fields. thanks guys
cat foo... (1 Reply)
Discussion started by: jack.bauer
1 Replies
4. Shell Programming and Scripting
I have a command lline script that works perfectly.
cat <some_filename> | awk '$9 == 200' | awk '$10 == 10623720' | awk -F\" '{print $6}' | sort | uniq -c | sort -r
I want to put this in a shell script so that we do this for multiple files(all read from a file list) and write each output to... (5 Replies)
Discussion started by: ampak
5 Replies
5. Shell Programming and Scripting
I'm rather new to programming, and am attempting to combine lines from 2 files in a way that is way beyond my expertise - any help would be appreciated!
I need to take a file (file1) and add columns to it from another file (file2). However, a line from file2 should only be added to a given line... (3 Replies)
Discussion started by: Cheri
3 Replies
6. Shell Programming and Scripting
Thanks for giving your time and effort to answer questions and helping newbies like me understand awk.
I have a huge file, millions of lines, so perl takes quite a bit of time, I'd like to convert these perl one liners to awk.
Basically I'd like all lines with ISA sandwiched between... (9 Replies)
Discussion started by: verge
9 Replies
7. Shell Programming and Scripting
Hi I have a log data that shows chunks of data like this:
thisis example test, this is example test, this is example test
thisis example test, this is example test, this is example test
thisis example test, this is example test, this is example test
thisis example test, this is example test,... (2 Replies)
Discussion started by: erick_tuk
2 Replies
8. Shell Programming and Scripting
How to combine 3 find statements into 1-liner?
find statements:
cd ${dir1} ; find . ! -name . -prune -type f | xargs file | grep -i ascii | cut -f1 -d: | xargs grep -l "${searchtxt}"
cd ${dir2} ; find . ! -name . -prune -type f | xargs file | grep -i ascii | cut -f1 -d: | xargs grep -l... (4 Replies)
Discussion started by: ux4me
4 Replies
9. Shell Programming and Scripting
Greetings, I attempting to create a line statement that will do the following:
1. Read the input file
2. Extract lines containing certain keep words
3. Print the lines in a tabular format (CSV)
Help is what I have so far:
# cat text.tx | egrep -i -e "(Check Name) | (Risk Level) |... (6 Replies)
Discussion started by: jroberson
6 Replies
10. Shell Programming and Scripting
Hello,
I have an awk command that searches and replaces. I have multiple searches, but I do not want to do them one after the other. Is there a way in awk to run search/replace at the same time.
thanks, (3 Replies)
Discussion started by: ctcuser
3 Replies