10 More Discussions You Might Find Interesting
1. UNIX for Beginners Questions & Answers
Hello,
I need to split a pipe de-limited file based on the COLUMN 7 value . If the column value changes I need to split the file
Source File
Payment|ID|DATE|TIME|CONTROLNUMBER|NUMBER|NAME|INDICATOR
42156974|1137937|10/1/2018|104440|4232|2054391|CARE|1... (9 Replies)
Discussion started by: rosebud123
9 Replies
2. Shell Programming and Scripting
In the below awk to add a sort by smallest to largest should it be added after the END? Thank you :).
BEGIN {
FS="*"
}
# Read search terms from file1 into 's'
FNR==NR {
s
next
}
{
# Check if $5 matches one of the search terms
for(i in s) {
if($5 ~ i) {
... (4 Replies)
Discussion started by: cmccabe
4 Replies
3. Shell Programming and Scripting
Hi guys,
I need to know how i can ignore Pipe '|' if Pipe is coming as a column in Pipe delimited file
for eg:
file 1:
xx|yy|"xyz|zzz"|zzz|12...
using below awk command
awk 'BEGIN {FS=OFS="|" } print $3
i would get xyz
But i want as :
xyz|zzz to consider as whole column... (13 Replies)
Discussion started by: rohit_shinez
13 Replies
4. Shell Programming and Scripting
Hey fellas,
I wrote an script which its output is like this:
a 1 T
a 1 T
a 2 A
b 5 G
b 5 G
b 5 G
I wanna print $1 $2 and the total number of $2 value as the third column and after that $3. Sth like this:
a 1 2 T
a 2 1 A
b 5 3 G
I know how to do it with a given input... (4 Replies)
Discussion started by: @man
4 Replies
5. Shell Programming and Scripting
I need to write a script to search a static file (file1) in the form
Name Email
tim tfxo@gmail.com
bob bob@sss.com
and then mail them another file (file2) that is input from the command line.
The command line would be:
script.awk who file2 subject
and the result would be
mail -s subject who... (2 Replies)
Discussion started by: tfxobrien
2 Replies
6. UNIX for Dummies Questions & Answers
Hi All. Thanks for your help in advance.
I have a requirement to examine the number of delimiters in each record of a file. If the record has the expected number of delimiters it should be passed into a 'good' file. If it does not, the record should be passed into a 'bad' file. I have been able... (8 Replies)
Discussion started by: codestar1
8 Replies
7. Shell Programming and Scripting
<tr><th align=right valign=top>Faulty_Part</th><td align=left valign=top>readhat version 6.0</td></tr> <tr><th align=right valign=top>Submit_Date</th><td align=left valign=top>2011-04-28 02:08:02</td></tr> .......(a long string)
I want to get all the field between "left valign=top>" and "... (2 Replies)
Discussion started by: yanglei_fage
2 Replies
8. Shell Programming and Scripting
Hi!
If I'm trying something like:
echo "hello world" | myvar=`awk -F "world" '{print $1}'`
echo $myvar
myvar is always empty :confused:
I googled for houres now and don't understand why it isn't working...
Trying it in normal bash.
Can someone explain it to me so I can say "Of course!... (8 Replies)
Discussion started by: al0x
8 Replies
9. UNIX for Dummies Questions & Answers
Hello,
does anybody have a clue why the following code isn't working in csh:
awk 'END{print FNR-5}' x.log | awk 'FNR<$1' x.log > x2.log
I want to remove the last 5 lines of a file without using a variable.
Thanks Tim (2 Replies)
Discussion started by: uxuser
2 Replies
10. Shell Programming and Scripting
This may just be a lack of experience talking, but I always assumed that when possible it was better to use a commands built in abilities rather than to pipe to a bunch of commands. I wrote a (very simple) script a while back that was meant to pull out a certain error code, and report back what... (4 Replies)
Discussion started by: DeCoTwc
4 Replies