###FEATURES COMMON TO BOTH AWK & SED### 1. $. +. . 3. 9.
Both are scripti! "a!a!es Both %or pri'ari"( %ith te)t *i"es Both are pro!ra''a,"e e-itors Both accept co''a-/"ie optios a- ca ,e scripte- 0/* scripta'e2 Both 4NU 5ersios spport 6OS78 04RE62 a- E4RE6 Re!E)es :iea!e ; e- 0e-itor2 /< se- /< a%
###SED=s FEATURES### 1. No/iteracti5e e-itor $. Strea' E-itor a. Maip"ates ipt / per*or'i! e-its as istrcte,. Se- accepts ipt o>*ro'? STD7N 0Ke(,oar-2@ Fi"e@ 6ipe 02 +. Se- :oops thro!h A:: ipt "ies o* ipt strea' or *i"e@ ,( DEFAU:T . Does NOT operate o the sorce *i"e@ ,( -e*a"t. 0Wi"" NOT c"o,,er the ori!ia" *i"e@ "ess istrcte- to -o so2 3. Spports a--resses to i-icate %hich "ies to operate o? >>- / -e"etes ,"a "ies 9. Stores acti5e 0crret2 "ie the =patter space= a- 'aitais a =ho"- space= *or sa!e . Use- pri'ari"( to per*or' Search/a-/Rep"aces ###AWK=s FEATURES### 1. Fie"- processor ,ase- o %hitespace@ ,( -e*a"t $. Use- *or reporti! 0e)tracti! speci*ic co"'s2 *ro' -ata *ee +. Spports pro!ra''i! costrcts a. "oops 0*or@%hi"e@-o2 ,. co-itios 0i*@the@e"se2 c. arra(s 0"ists2 -. *ctios 0stri!@ 'eric@ ser/-e*ie-2 . Ato'atica""( toeies %or-s i a "ie *or "ater sa!e / 1@ $@ +@ etc. 0This is ,ase- o the crret -e"i'iter2 3. Ato'atica""( "oops thro!h ipt "ie Se-@ 'ai! "ies a5ai"a,"e *or processi! 9. A,i"it( to e)ecte she"" co''a-s si! =s(ste'02= *ctios
###RE4U:AR E86RESS7ONS 0Re!E)2 RE7EW### Re!"ar E)pressios 0Re!E)es2 are e( to 'asteri! A% & Se###METACHARACTERS### / 'atches the character0s2 at the ,e!ii! o* a "ie a. se- /e =>-o!>p= ai'a"s.t)t / 'atches the character0s2 at the e- o* a "ie a. se- /e =>-o!>p= ai'a"s.t)t Tas? Match "ie %hich cotais o"( =-o!=? a. se- /e =>-o!>p= ai'a"s.t)t ,. se- /e =>-o!>p= / rea-s *ro' STD7N. 6ress Eter a*ter each "ie. Ter'iate %ith CTR:/D c. cat ai'a"s.t)t se- /e =>-o!>p= -. cat ai'a"s.t)t se- /e =>-o!>7p= / prits 'atches case/isesiti5e"( . / 'atches a( character 0t(pica""( e)cept e% "ie2 a. se- /e =>-...>7p= ai'a"s.t)t ,. se- /e =>-...>7p= ai'a"s.t)t
###RE4E8 / I or J / 1 or ; I or
GUANT7F7ERS### 'ore 'atches o* the pre5ios character 'ore 'atches o* the pre5ios character 1 o* the pre5ios character
,. se- /e =>-.LJ>7p= ai'a"s.t)t Note? Escape ati*iers i Re!E)es si! the escape character =L= ###CHARACTERS C:ASSES### A""o%s to search *or a ra!e o* characters a. I/P ,. a/PA/QP a. se- /e =>-.LJI/P>7p= ai'a"s.t)t Note? Character C"asses 'atch 1@ a- o"( 1 character
###7NTRO TO SED### Usa!e? 1. se- optiosP =istrctio= *i"e 676E STD7N $. se- /e =istrctio1= /e =istrctio$= ... +. se- /* script*i"ea'e *i"e Note? E)ecte Se- ,( i-icati! istrctio o oe o* the *o""o%i!? 1. Co''a-/"ie $. Script Fi"e Note? Se- accepts istrctios ,ase- o =>patterto'atch>actio= ###6rit Speci*ic :ies o* a *i"e### Note? =/e= is optioa" i* there is o"( 1 istrctio to e)ecte se- /e =1p= ai'a"s.t)t / prits *irst "ie o* *i"e se- /e =$p= ai'a"s.t)t / prits seco- "ie o* *i"e se- /e =p= ai'a"s.t)t / prits "ast prita,"e "ie o* *i"e se- /e =$@p= ai'a"s.t)t / prits "ies $/ *ro' *i"e se- /e =1p= ai'a"s.t)t / prits A:: "ies E8CE6T "ie #1 se- /e =1@p= ai'a"s.t)t / prits A:: "ies E8CE6T "ies 1 / se- /e =>-o!>p= ai'a"s.t)t / prits A:: "ies cotaii! =-o!= / case/sesiti5e se- /e =>-o!>7p= ai'a"s.t)t / prits A:: "ies cotaii! =-o!= / case/ isesiti5e se- /e =>I/P>p= ai'a"s.t)t / prits A:: "ies %ith AT :EAST 1 'eric se- /e =>cat>@>-eer>p= ai'a"s.t)t / prits A:: "ies ,e!ii! %ith =cat=@ e-i! %ith =-eer= se- /e =>-eer>@J$p= ai'a"s.t)t / prits the "ie %ith =-eer= p"s $ e)tra "ies ###De"ete :ies si! Se- A--resses### se- /e =>>-= ai'a"s.t)t / -e"etes ,"a "ies *ro' *i"e Note? Drop =/= to see the e% otpt %he -e"eti! se- /e =1-= ai'a"s.t)t / -e"etes the *irst "ie *ro' ai'a"s.t)t se- /e =1@-= ai'a"s.t)t / -e"etes "ies 1/ *ro' ai'a"s.t)t se- /e =1$-= ai'a"s.t)t / -e"etes e5er( $- "ie ,e!ii! %ith "ie 1 / 1@+@3... ###Sa5e Se-=s Cha!es si! Otpt Re-irectio### se- /e =>>-= ai'a"s.t)t < ai'a"s$.t)t / -e"etes ,"a "ies *ro' *i"e acreates e% otpt *i"e =ai'a"s$.t)t=
###SEARCH & RE6:ACE US7N4 Se-### 4eera" Usa!e? se- /e =s>*i->rep"ace>!= ai'a"s.t)t / rep"aces =*i-= %ith =rep"ace= Note? :e*t Ha- Si-e 0:HS2 spports "itera"s a- Re!E)es Note? Ri!ht Ha- Si-e 0RHS2 spports "itera"s a- ,ac re*ereces E)a'p"es? se- /e =s>:i)CBT>Ui)CBT>= / rep"aces =:i)CBT= %ith =Ui)CBT= o STD7N to STDOUT se- /e =s>:i)CBT>Ui)CBT>7= / rep"aces =:i)CBT= %ith =Ui)CBT= o STD7N to STDOUT 0Case/7sesiti5e2 Note? Rep"ace'ets occr o the F7RST 'atch@ "ess =!= is appe-e- to the s>*i->rep"ace>! seece se- /e =s>:i)CBT>Ui)CBT>7!= / rep"aces =:i)CBT= %ith =Ui)CBT= o STD7N to STDOUT 0Case/7sesiti5e & 4"o,a"2 Tas? 1. Re'o5e A:: ,"a "ies $. S,stitte =cat=@ re!ar-"ess o* case@ %ith =Ti!er= Note? Whe5er si! =/= optio@ (o MUST speci*( the prit 'o-i*ier =p= se- /e =>>-= /e =s>Cat>Ti!er>7!= ai'a"s.t)t / re'o5es ,"a "ies & s,stittes =cat= %ith =Ti!er= OR se- /e =>>- s>Cat>Ti!er>7!p= ai'a"s.t)t / -oes the sa'e as a,o5e Note? Si'p"( separate '"tip"e co''a-s %ith se'ico"os ###Up-ate Sorce Fi"e / Bacp Sorce Fi"e### se- /i.,a /e =>>- s>Cat>Ti!er>7!p= ai'a"s.t)t / per*or's as a,o5e@ ,t A:SO rep"aces the sorce *i"e a- ,acs it p
###Search & Rep"ace 0Te)t S,stittio2 Cotie-### se- /e =>a--ress>s>*i->rep"ace>!= *i"e se- /e =>Ti!er>s>-o!>'tt>!= ai'a"s.t)t se- /e =>Ti!er>s>-o!>'tt>!p= ai'a"s.t)t / s,stittes =-o!= %ith ='tt= %here "ie cotais =Ti!er= se- /e =>Ti!er>s>-o!>'tt>!7= ai'a"s.t)t se- /e =>Ti!er>s>-o!>'tt>!7= ai'a"s.t)t / Up-ates "ies that ,e!i %ith =Ti!er= se- /e =>Ti!er>7s>-o!>'tt>!7= ai'a"s.t)t / Up-ates "ies that ,e!i %ith =Ti!er= 0Case/7sesiti5e2 ###Focs o the Ri!ht Ha- Si-e 0RHS2 o* Search & Rep"ace Fctios i SED### Note? SED reser5es a *e% characters to he"p %ith s,stittios ,ase- o the 'atchepatter *ro' the :HS & ; The *"" 5a"e o* the :HS 06atter Matche-2 OR the 5a"es i the patter space Tas? 7tersperse each "ie %ith the %or- =Ai'a" = se- /e =s>.>&>p= ai'a"s.t)t / rep"aces the 'atche- patter %ith the 'atchepatter se- /e =s>.>Ai'a" &>p= ai'a"s.t)t / 7tersperses =Ai'a"= o each "ie se- /e =s>.>Ai'a"? &>p= ai'a"s.t)t / 7tersperses =Ai'a"= o each "ie sethe sethe se-
/e e/e e/e
=s>.I/P>&>p= ai'a"s.t)t / retrs ai'a"s %ith at "east 1 'eric at o* the a'e =s>.I/PL1LV>&>p= ai'a"s.t)t / retrs ai'a"s %ith o"( 1 'eric at o* the a'e =s>a/PI/PLLV>&>p7= ai'a"s.t)t / retrs ai'a"0s2 %ith 'eric
5a"es at the e- o* the a'e se- /e =s>a/PI/PL1@LV>&>p7= ai'a"s.t)t / retrs ai'a"0s2 %ith at "east 1@ p to 'eric 5a"es at the e- o* the a'e ###4ropi! & Bacre*ereces### Note? Se!e'et 'atches ito ,acre*ereces si! escape- parethesis? L0Re!E)L2 se- /e =s>L0.L2L0I/PL2>&>p= ai'a"s.t)t / This creates $ 5aria,"es? L1 & L$ se- /e =s>L0.L2L0I/PL2>L1>p= ai'a"s.t)t / This creates $ 5aria,"es? L1 & L$ ,t re*ereces L1 se- /e =s>L0.L2L0I/PL2>L$>p= ai'a"s.t)t / This creates $ 5aria,"es? L1 & L$ ,t re*ereces L$ se- /e =s>L0.L2L0I/PL2>L1 L$>p= ai'a"s.t)t / This creates $ 5aria,"es? L1 & L $ ,t re*ereces L1 & L$
###App"( Cha!es to M"tip"e Fi"es### Se- Spports 4"o,,i! 5ia %i"-car-s? @ se- /e =s>L0.L2L0I/PL2>L1 L$>p= ai'a"st)t / This creates $ 5aria,"es? L1 & L $ ,t re*ereces L1 & L$ ###Se- Scripts### Note? Se- spports scripti!@ %hich 'eas@ the a,i"it( to -'p 1 or 'ore istrctios ito 1 *i"e se- /* script*i"ea'e te)t*i"e se- /* ai'a"s.se- ai'a"s.t)t Tas? 6er*or' '"tip"e tras*or'atios o ai'a"s.t)t *i"e 1. >>- / Re'o5es ,"a "ies $. s>-o!>*ro!>7! / s,stittes !"o,a""(@ =-o!= %ith =*ro!= / 0case/isesiti5e2 +. s>ti!er>"io>7! / s,stitte !"o,a""(@ =ti!er= %ith ="io= / 0case/isesiti5e2 . s>.>Ai'a"s? &> / 7tersperse- =Ai'a"s?= 3. s>ai'a"s>'a''a"s>7! / Rep"ace- =Ai'a"s= %ith ='a''a"s= 9. s>L0a/PL2L0I/PL2>L1>7p / Strips trai"i! 'eric 5a"es *ro' a"phas Se 1. $. +.
Scripti! R"es? Se- app"ies A:: r"es to each "ie Se- app"ies A:: cha!es -(a'ica""( to the patter space Se- A:WAS %ors %ith the crret "ie
###A% / 7tro### Featres? 1. Reporter $. Fie"- 6rocessor +. Spports Scripti! . 6ro!ra''i! Costrcts 3. De*a"t -e"i'iter is %hitespace 9. Spports? 6ipes@ Fi"es@ a- STD7N as sorces o* ipt . Ato'atica""( toeies processe- co"'s>*ie"-s ito the 5aria,"es? 1@ $@ + .. X. Spports 4RE6 a- E4RE6 Re!E)es Usa!e? a% =istrctiosV= *i"e0s2 a% =>patter> proce-re V= *i"e a% /* script*i"e *i"e0s2
Tass? Note? I represets the crret recor- or ro% 1. 6rit etire ro%@ oe at a ti'e@ *ro' a ipt *i"e 0ai'a"s.t)t2 a. a% = prit I V= ai'a"s.t)t $. 6rit speci*ic co"'s *ro' 0ai'a"s.t)t2 a. a% = prit 1 V= ai'a"s.t)t / this prits the 1st co"' *ro' the *i"e +. 6rit '"tip"e co"'s *ro' 0ai'a"s.t)t2 a. a% = prit 1 prit $ V= ai'a"s.t)t ,. a% = prit 1@$ V= ai'a"s.t)t . 6rit co"'s *ro' "ies cotaii! =-eer= si! Re!E) Spport a. a% =>-eer> prit I V= ai'a"s.t)t 3. 6rit co"'s *ro' "ies cotaii! -i!its a. a% =>I/P> prit I V= ai'a"s.t)t 9. Re'o5e ,"a "ies %ith Se- a- pipe otpt to a% *or processi! a. se- /e >>- ai'a"s.t)t a% =>I/P> prit I V= . 6rit ,"a "ies a. a% =>> prit V= ai'a"s.t)t OR ,. a% =>> prit I V= ai'a"s.t)t X. 6rit A:: "ies ,e!ii! %ith the ai'a" =-o!= case/isesit5e a. a% =>-o!>7 prit V= ai'a"s.t)t ###De"i'iters### De*a"t -e"i'iter? %hitespace 0space@ ta,s2 Use? =/F= to i*"ece the -e*a"t -e"i'iter Tas? 1. 6arse >etc>pass%- si! a% a. a% /F? = prit V = >etc>pass% ,. a% /F? = prit 1@ 3 V = >etc>pass%$. Spport *or character c"asses i setti! the -e*a"t -e"i'iter a. a% /FY?@LtPY
###A% Scripts### Featres? 1. A,i"it( to or!aie patters a- proce-res ito a script *i"e $. The patters>proce-res are 'ch eater a- easier to rea +. :ess i*or'atio is p"ace- o the co''a-/"ie . B( -e*a"t@ "oops thro!h "ies o* ipt *ro' 5arios sorces? STD7N@ 6ipe@ *i"es 3. # is the -e*a"t co''et character 9. A,"e to per*or' 'atches ,ase- o speci*ic *ie"-s A% 1. rea$. +.
Scripts cosist o* + parts? Be*ore 0-eote- si!? BE47N2 / E)ecte- prior to F7RST "ie o* ipt ,ei! Dri! 0Mai A% "oop2 / Focses o "oopi! thro!h "ies o* ipt A*ter 0-eote- si!? END2 / E)ecte- a*ter the :AST "ie o* ipt has ,ee
processe Note? BE47N a- END co'poets o* A% scripts are O6T7ONA: Tass? 1. 6rit to the scree so'e se*" i*or'atio %ithot rea-i! ipt 0STD7N@ 6ipe@ or Fi"e2 a. a% =BE47N prit YTesti! A% %ithot ipt *i"eY V = $. Set s(ste' 5aria,"e? FS to co"o i BE47N ,"oc a. a% =BE47N FS ; Y?Y prit YTesti! A% %ithot ipt *i"eY V= ,. a% =BE47N FS ; Y?Y prit FS V= +. Write script to e)tract ro%s %hich cotai =-eer= *ro' ai'a"s.t)t si! Re!E) a. a% /* ai'a"s.a% ai'a"s.t)t . 6arse >etc>pass% a. prit etire "ies / prit V ,. prit speci*ic co"'s / prit 1@ 3 V c. prit speci*ic co"'s *or a speci*ic ser / >"i)c,t> prit 1@ 3 V -. prit speci*ic co"'s *or a speci*ic ser 'atchi! a !i5e co"' / 1 >"i)c,t> prit 1@ 3 V e. test co"' # *or the stri! =,ash= / >,ash> prit V
###A% aria,"es### Featres + T(pes o* 5aria,"es? 1. S(ste' / i.e. F7:ENAME@ RS@ ORS... $. Sca"ars / i.e. a ; + +. Arra(s / i.e. 5aria,"ea'eP Note? aria,"es -o ot ee- to ,e -ec"are-. A%@ ato'atica""( re!isters the' i 'e'or( Note? aria,"e a'es ARE case/sesiti5e S(ste' aria,"es? 1. F7:ENAME / a'e o* crret ipt *i"e $. FNR / se- %he '"tip"e ipt *i"es are se +. FS / *ie"- separator / -e*a"ts to %hitespace / ca ,e a si!"e character@ ic"-i! 5ia a Re!E) . OFS / otpt *ie"- separator / -e*a"ts to %hitespace 3. NF / ',er o* *ie"-s i the crret recor 9. NR / crret recor- ',er 0it is ato/s''e- %he re*erece- i END sectio2 . RS / recor- separator / -e*a"ts to a e%"ie X. ORS / otpt recor- separator / -e*a"ts to a e%"ie . AR4 / arra( o* co''a-/"ie ar!r'ets / i-e)e- at I@ ,e!ii! %ith 1 1I. AR4C / tota" # o* co''a-/"ie ar!'ets 11. EN7RON / arra( o* e5iro'et 5aria,"es *or the crret ser
Tass? 1. prit e( s(ste' 5aria,"es a. prit F7:ENAME 0prit a(%here a*ter the BE47N ,"oc2 ,. prit NF / ',er o* *ie"-s per recorc. prit NR / crret recor- ',er -. prit AR4C / retrs tota" ',er o* co''a-/"ie ar!'ets Sca"ar aria,"es? 5aria,"ea'e ; 5a"e
a!e ; 3I Note? Set sca"ars i the BE47N sectio@ ho%e5er@ the( ca ,e@ i* reire-@ set i the 'ai "oop JJa!e V / icre'ets 5aria,"e =a!e= ,( 1@ *or each iteratio o* the 'ai "oop 0co'poet $ o* +2 Set 5aria,"e to stri! si! -o,"e otes? *""a'e ; YDea Da5isY Cocateate 5aria,"es ,( separati! the 5a"es si! a space *""a'e ; YDeaY YDa5isY Arra( aria,"es? Featre? 1. :ist o* i*or'atio Tas? 1. De*ie a arra( 5aria,"e to store 5arios a!es a. a!eIP ; 3I $. Use sp"it *ctio to ato/,i"- a arra( a. arr1' ; sp"it0stri!@ arra(@ separator2 ###Operators### Featres? 1. 6ro5i-es co'pariso too"s *or e)pressios $. 4eera""( $ t(pes? a. Re"atioa" / ;;@ ;@ Z@ <@ Z;@ <;@ 0Re!E) Matches2@ 0Re!E) Does NOT Match2 ,. Boo"ea / 0OR2@ &&0AND2@ 0NOT2 / Co',ies co'parisos +. 6rit so'ethi! i* the crret recor- ',er is < 1I a. NR < 1I prit YCrret Recor- N',er is !reater tha 1IY V . E)tract recor-s %ith ON: $ *ie"-s a. NF ;; $ prit V . Fi- recor-s that ha5e at "east $ *ie"-s a- are positioe- at recor- 3 or hi!her a. NF <; $ && NR <;3 prit V ###:oops### Featres? 1. Spport *or? %hi"e@ -o@ a- *or Whi"e? %hi"e 0NR < 1I2 prit Y4reater tha 1IY V For? *or0i;1 i Z;1I JJi2 prit i Do / per*or's the actio carrie-/ot ,( %hi"e at "east oce? -o actio %hi"e 0co-itio2 ###6rocessi! Recor-s %ith A%### Tas? 1. 6rocess '"tip"e -e"i'iters i the sa'e *i"e 0across recor-s2 a. a% /F Y? PY = prit V= ai'a"s$.t)t ,. a% =BE47N FS;Y ?PY V prit $ V= ai'a"s$.t)t
c. a% /* scripta'e ai'a"s$.t)t $. 6rocess '"tip"e -e"i'iters o the sa'e "ie a. Note? Script -oes NOT cha!e@ ho%e5er@ ipt *i"e DOES +. Nor'a"ie the Otpt Fie"- Separator 0OFS2 BE47N OFS;Y?Y V . Bi"- ai'a"c"asses arra( *ro' the "ist o* c"asses i ai'a"s$.t)t a. ai'a"c"assNRP ; $ V / p"ace i 'ai "oop / ,i"-s ai'a"c"ass arra( 3. E)tract Dae'o etries *ro' >5ar>"o!>'essa!es a. e)tract ere" 'essa!es a1. a% /* test.a% >5ar>"o!>'essa!es ,1. a% /* "i)c,t>test.a% 'essa!es a% =X >error> prit 3@9@@X@ V= c1. a% /* "i)c,t>test.a% 'essa!es a% =BE47N prit YHERE ARE THE ERROR MESSA4ESYV X >error> prit 1@$@+@@3@9@@X@@1I@11@1$ V END prit Y6rocess Co'p"eteY V= ###6rit* For'atti!### Featre? 1. A,i"it( to cotro" the %i-th o* *ie"-s i the otpt Usa!e? prit*0Y*or'atY@ ar!'ets2 Spporte- 6rit* For'ats ic"-e? 1. [c / ASC77 Characters $. [- / Deci'a"s / NOT *"oati! poit 5a"es OR 5a"es to the ri!ht o* the -eci'a" poit +. [* / F"oati! 6oit . [s / Stri!s Note? prit* -oes NO prit e%"ie character0s2 This 'eas (o="" ee- to i-icate a e%"ie character seece? L / i the Y*or'atY sectio o* the prit* *ctio Note? De*a"t otpt is ri!ht/\sti*ie-. Use =/= to i-icate "e*t/\sti*icatio 4eera" *or'at sectio? /P%i-th.precisioc-*sP %i-th / i*"eces the acta" %i-th o* the co"' to ,e otpt precisio / i*"eces the ',er o* p"aces to the ri!ht o* the -eci'a" poit precisio / A:SO i*"eces the ',er o* stri!s to ,e prite- *ro' a stri!
E)a'p"es Tass? 1. prit YTesti! prit*Y *ro' the co''a-/"ie a. a% =BE47N prit*0YTesti! prit*LY2 V= $. rea- =ai'a"s.t)t= a- *or'at the otpt %ith prit* a. a% =BE47N prit*0YHere is the otptLY2V prit*0Y[sLt[sLY@ 1@$2 V= ai'a"s.t)t +. App"( %i-th a- precisio to tas #$ a. a% =BE47N prit*0YHere is the otptLY2V prit*0Y[.sLt[.sLY@ 1@$2 V= ai'a"s.t)t ,. a% =BE47N prit*0YHere is the otptLY2V prit*0Y[$IsLt[$IsLY@ 1@$2 V= ai'a"s.t)t . :e*t/\sti*( tas #+ a. a% =BE47N prit*0YHere is the otptLY2V prit*0Y[/$IsLt[/$IsLY@ 1@$2 V= ai'a"s.t)t
3. 6arse ai'a"s%ithprices.t)t *i"e a- proper"( represet stri!s@ -eci'a"s a*"oati! poit 5a"es a. a% =BE47N prit*0YHere is the otptLLY2V prit*0Y[/3sLt[.$*LY@ 1@$2 V= ai'a"s%ithprices.t)t 9. For'at si! prit* ai'a"s$.t)t a. *or 0i;1 i Z; NR iJJ2 prit*0Y[/1$s [1- [/$s [/1IsLY@ YAi'a" C"assY@ i@ Y? Y@ ai'a"c"assiP2 . App"( pper a- "o%er/case *or'atti! to prit* 5a"es a. prit*0Y[/1$s [1- [/$s [/1IsLY@ YAN7MA: C:ASSY@ i@ Y? Y@ topper0ai'a"c"assiP22 ,. prit*0Y[/1$s [1- [/$s [/1IsLY@ YAN7MA: C:ASSY@ i@ Y? Y@ to"o%er0ai'a"c"assiP22 X. For'at otpt *ro' >5ar>"o!>'essa!es a. E)tract -ate@ ti'e@ ser5er a- -ae'o co"'s@ ic"-e a hea-er BE47N
###A--itioa" Se- & A% E)a'p"es### Tas? 1. Up-ate 6H6 %e, pa!es to re'o5e =Shippi!? Free= %here5er it e)ists a. Co-e to re'o5e? Z,,&,spFreeZ,r< se- /i.,a /e =s>Z,,&,spFreeZ,r<>>= pro-cts"i)c,tsecrit(e-itio.php ,. E**ect the cha!e to A:: pro-ct *i"es a- create .e% otpt *i"es %ithot c"o,,eri! the sorce *i"es *or i i ]"s /A pro-ctsphp] -o se- /e =s>Z,,&,spFreeZ,r<>>= i < i.e% -oe $. Strip =.e%= s**i) *ro' e%"( !eerate- *i"es a. echo Ypro-cts"i)c,t.php.e%Y se- /e =s>L.e%>>= ,. *or i i ]"s /A pro-ctse% se- /e =s>L.e%>>=] -o echo i -oe c. *or i i ]"s /A pro-ctse% se- /e =s>L.e%>>=] -o '5 i.e% i -oe +. Re'o5e =Free Shippi!= *ro' *a.php *i"e a. Co-e to re'o5e? Z"iZ"i>= *a.php < *a.php.e%
Use A% & Se- To!ether to p-ate speci*ic ro%s i >5ar>"o!>'essa!es? Tas? a. Up-ate Moth i*or'atio *or ere" 'essa!es *or Septe',er + a% =1 >Sep> && $ >+> && 3 >ere"> prit V= >5ar>"o!>'essa!es ,. a% =1 >Sep> && $ >+> && 3 >ere"> JJtota" V prit V END prit YTota" Recor-s Up-ate-? Y tota" V= >5ar>"o!>'essa!es se- /e =s>Sep>Septe',er>p= ###Wi-o%s Spport *or 4NU Se- & A%### Do%"oa- 4NU Se- & A% *ro'? http?>>!%i+$.sorce*or!.et Wi-o%s St**? !a% YBE47N 'a);AR41P *or 0i;1iZ;'a)JJi2 prit i VY 1I / rea-s 1I *ro' AR41P a- passes it to ='a)= 5ar *or se i the =*or= "oop