It's actually much easier to stack the variable and shorten the logical condition like the way you did.
I'm really glad to have learned this technique.
Thank you
PS: Script editing is not a real problem because it is embedded in an AppleScript.
I'm stuck on a problem of array printing and a "if" condition . I tried different combinations with the 'for' loop but the result always returns empty. Also when I try to include the "else" statement, I invariably get an "illegal instruction" message.
Could you help me on this?
--- SAMPLE ---...
Hi Feherke,
Thank you for the script, it works perfectly. (as usual !)
One question though, why the if statement line in the "END" procedure? Could you help me understand ?
Hello everyone,
The extract below is the result of a pipe passed through sed with which I clean white space from HTML pages.
/* --- SAMPLE --- */
...
<a href='/books/filebooks_gen_cbooks=41386.html'>
<b>L'école de la chair</b></a>
(Nikutai No Gakka)<br />
<span class=\"fs11\">
1963<br />...
Hello All,
I would like to split a big "pipe" delimited file in as many files as there are columns. The number of columns being undefined, how to make so that each column header acts as the output file name?
Sample IN
header1|header2|...|headern
11111|txt1|...|alphanum_n1...
Annihilannic,
You make my day !
Unfortunately the fields contain spaces and other HTML delicacies which I need, as well as the field "flags" which is crushed in the last substitution. But I will manage this by myself.
Thank you for your input, code, explanations & ideas !
Regards
Clement
Excuse me to reconsider this subject, but is my problem really unrealizable?
If so, would you be so kind to point me in the right direction.
Thank you in advance.
Hello everyone;
I have plenty of very large (>60Mo) pseudo-xml files which looks as follows:
<?xml version="1.0" encoding="UTF-8"?>
... more lines here
</ObjectStyle>
<Object type="Field" flags="67108864" flags="67108864">
<Style>128</Style>
<Bounds top=" 24" left="138" bottom=" 38"...
Thank you Futurelet for your answer
I tried your code, but I'm loosing the delimiter (vertical bar)
I get this
=2006062859.9370-11125.619
instead of:
=2006|0628|59.9370-111|25.619
Hello,
I'm trying to append a line to previous if it doesn't begin with a equal sign
Input
...
=POUILLY SUR VINGEANNE
=2006
0628
59.9370-111
25.619
=45370
...
Expected Output:
...
=POUILLY SUR VINGEANNE
=2006|0628|59.9370-111|25.619
=45370
What I've tried so far:
awk '/^=/ {if (line) print...
Hi all,
Just wondering if there's a way to write the following command in just one awk call:
#!/bin/sh
...
awk '{printf "%s" (NR%5 ? "\t" : "\n"),$0}' | awk 'BEGIN{OFS="\t"} {print "'"$1"'", "'"$2"'", $2, $1, $3, $4, $5, "'"`date +%d\/%m\/%Y\ %H:%M:%S`"'", ""}'
...
stdout=
27/07/07
92410...
Excuse me for this late answer, I exceptionally granted myself long holidays :)
So, many thanks to Vlad and Feherke for their answers.
(Works perfectly under OS X)
Clement
Hi All,
I'm quite new to awk...
I did search on this forum but did not find a solution to my problem..
The problem i am having is how to write this in awk (or sed ):
- If a line does not end with a parenthese '(', join every following line till one begining with a ')'-
---------- Input
...
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.