Very doable with sed, but messy as a one-liner
E.g.
sed -n -e '/regexp1/{' -e '/regexp2/{' -e '/regexp3/p' -e '}' -e '}' filename
or
$ sed -n '
/regexp1/{
/regexp2/{
/regexp3/p
}
> }' filename
Cheers,
ND [smile]
Not requested, but sed is fun:
sed '
/^[0-9]\{1,\}-[0-9]\{1,\}/{
s/;.*//
N
s/\n\([^ ]*\) .*/ \1/
N
s/\n\([^ ]*\) .*/ \1/
}' sedFinal.txt
Cheers,
ND [smile]
Here's a way if you want to remove the terminal byte:
dd if=inputfile ibs=1 count=$(expr "$(wc -c foo)" : "\([^ ]*\)*" - 1) of=outputfile
Cheers,
ND [smile]
Yogi's solution does what I hoped. But instead of the performance hits of copying calculating down multiple cells and dealing with array-based formulas I've settled for the easier conditional formatting trick to match the font color to the background. Why do I think of harder solutions first...
Does anyone know how to find the first preceding non-blank cell in a column based on some starting reference address? I'd like to do this using Excel built-in functions, not VBA (yeah, vba would be simple).
Cheers,
ND [smile]
sed can still a good alternative if the pattern stays consistent.
sed 's/[a-z]\{2,\}_[0-9]\{1,\}=//g'
or even:
sed 's/.._[0-9]\{1,\}=//g'
Cheers,
ND [smile]
Oh, if you still need to filter the status number from to 1-200 then ammend the filter portion
awk '$11=="status" && $12>=1 && $12<=200 {...
Cheers,
ND [smile]
Are the status and the number strings in the same columns at all times? Is the data in order? If yes, e.g. $2 & $3, then this is super easy.awk '/status [12]/print $8 > $2 $3".txt";{if(/status 200/)exit}' error.txt
Cheers,
ND [smile]
You might reasses salary since 6-8 months later puts you squarely in a new fiscal year. You could also justify a renegotion saying you never fully talked through medical, 401 k contributions, etc. You should also re-explore the position with the hiring manager to see how the position has...
I tried out the following, but it certainly fails on both points made by columb (memory and use of pseudo-rand).
perl -e '@a = <>; print splice @a, rand @a, 1 while @a' /input/file > /scrambled/file
I'd run this by the C or possibly the perl people. You'll probably have to have run some...
Does vi show something like ^M at the end of each line? Your terminal probably doesn't, but I'd bet your problem is a carriage return character at the end of each line. Has DOS or Windows touched this data? The '.' wildcard takes care of the issue in the egrep. Here's a possible fixtr -d...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.