Search Results

Search: Posts Made By: jawsnnn
7,116
Posted By jawsnnn
I was under the impression that the string...
I was under the impression that the string (gender) was part of your sample file.

Change the code to :

sed 's/^Male\|^Female/&*/g' file1 | awk -F'\n' '$2 ~ /^Smith/ {print}' RS='*'


For...
4,389
Posted By jawsnnn
Is this what you're looking for? find...
Is this what you're looking for?


find /data/raw_files -type f -exec zip -j bundle.zip {} \;
8,493
Posted By jawsnnn
I would suggest the following approach: ...
I would suggest the following approach:


sed 's:</record>:&*:g' file1 | awk 'index($0,"isup")==0{print $0}' RS='*'


Would not work with nested tags and such.

You may want to surround isup...
2,017
Posted By jawsnnn
Try this awk -F',' '{OFS=","}{ for...
Try this

awk -F',' '{OFS=","}{ for (i=1;i<NF;i++) {printf("%-15s,",$i)}{printf($NF"\n")}}' file1
890
Posted By jawsnnn
I guess (and it is just a guess, since I know...
I guess (and it is just a guess, since I know next to nothing about how shell works) is that
1. Since the variable $FILE may refer to more than one files, grep is showing you the exact filename...
6,570
Posted By jawsnnn
Your basic global substitution syntax for sed is:...
Your basic global substitution syntax for sed is:

's/search_term/replace_term/g'

This sed command says that:

1. search for any character combination, i.e. \(.*\). Here .* represents any...
6,570
Posted By jawsnnn
My bad. This one inserts the "_failed" command...
My bad. This one inserts the "_failed" command before the extension.


#!/bin/ksh
if [ -e $1 ]; then
ofile=`echo $1 | sed 's/\(.*\)\.\(.*\)/\1_failed.\2/g'`
cp "$1" "${ofile}"
fi

...
8,930
Posted By jawsnnn
If you don't want to rely on properly formatted...
If you don't want to rely on properly formatted code, here is a script that keeps track of left and right parentheses counts to do this


#!/bin/ksh
count_prev=0
count=0
mask=false
while read...
2,086
Posted By jawsnnn
Something like this maybe: for ((...
Something like this maybe:


for (( i=0;i<20;i++ )) do awk '{OFS="\t"}NR!=1{{printf($1"\t")} for (j=1;j<=5;j++) {c=j+('$i'*5)+1; printf($c"\t")}{printf("\n")}}' file1 > file_$i; done;


Here,...
Showing results 1 to 9 of 9

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