1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<HTML
><HEAD
><TITLE
>String</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
REL="HOME"
TITLE="TEA Manual"
HREF="index.html"><LINK
REL="UP"
TITLE="Functions"
HREF="c371.html"><LINK
REL="PREVIOUS"
TITLE="Numbers"
HREF="x631.html"><LINK
REL="NEXT"
TITLE="Sort"
HREF="x700.html"></HEAD
><BODY
CLASS="section"
BGCOLOR="#FFFFFF"
TEXT="#000000"
LINK="#0000FF"
VLINK="#840084"
ALINK="#0000FF"
><DIV
CLASS="NAVHEADER"
><TABLE
SUMMARY="Header navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>TEA Manual</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="x631.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
>Chapter 9. Functions</TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="x700.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><DIV
CLASS="section"
><H1
CLASS="section"
><A
NAME="AEN647"
>9.14. String</A
></H1
><P
> <SPAN
CLASS="bold"
><B
CLASS="emphasis"
>Split by the delimeter</B
></SPAN
> - actually, this function replaces all delimeters in a text with the new line character. Set the delimeter value in the Famous text entry.
</P
><P
> <SPAN
CLASS="bold"
><B
CLASS="emphasis"
>Split after the delimeter</B
></SPAN
> - adds the line line character after the each delimeter found in a text. Set the delimeter value in the Famous text entry.
</P
><P
> <SPAN
CLASS="bold"
><B
CLASS="emphasis"
>CSV-like table to LaTeX table</B
></SPAN
> - use this function if you want to convert a CSV-like table into the LaTeX table format. How it works?
</P
><P
> Open the OpenOffice.org Calc or Gnumeric, and save your table sheet as a CSV-file. It is a simple text file where cells are separated with some delimiting character (separator), usually comma (comma-separated file). But if you have commas in cells, use another character as a delimiter. If Gnumeric you should use <SPAN
CLASS="bold"
><B
CLASS="emphasis"
>Save as - Export as text files</B
></SPAN
> where you can define the separator.
</P
><P
> Then open your CSV-file in TEA. Select the text. Use <SPAN
CLASS="bold"
><B
CLASS="emphasis"
>CSV-like table to LaTeX table</B
></SPAN
>. Voila!
</P
><P
><SPAN
CLASS="bold"
><B
CLASS="emphasis"
>Split to TeX paragraphs</B
></SPAN
> - splits the text to TeX paragraphs, adding empty lines between strings. To convert your plain text into TeX, your first step should be use of this function.
</P
><P
><SPAN
CLASS="bold"
><B
CLASS="emphasis"
>Convert usual quotes to TeX quotes</B
></SPAN
> - yes it is. Just a one note - it process double-quotes only.
</P
><P
> <SPAN
CLASS="bold"
><B
CLASS="emphasis"
>Escape and quote/Unescape and unquote</B
></SPAN
> - you know, all that coders stuff, when you need escape/unescape some string or a filename full of that damned whitespaces.
</P
><P
><SPAN
CLASS="bold"
><B
CLASS="emphasis"
>Numerate lines</B
></SPAN
> - numerates selected lines. Define the format of numeration in the famous text entry. The format is a weird one:
<SPAN
CLASS="emphasis"
><I
CLASS="emphasis"
>printf-like format string~step of the counter~initial value of the counter</I
></SPAN
>. The two last parameters are optional and equal to 1 by default. Let's imagine that you have a list of music bands:
</P
><P
CLASS="literallayout"
>Nirvana<br>
Scorn<br>
Napalm Death<br>
Defecation<br>
Neck<br>
JR Ewing<br>
Fall<br>
Meathook Seed<br>
The Doors<br>
Led Zeppelin</P
><P
>Now you want to add a numbering to that list, and in the custom format. So, TEA can do it for you. You write the format string into the FAMOUS text entry. The format string is a very printf-like, i.e. you can use two macros - %d for a counter and %s for a string. To be more clear - %d represents the counter, and %s represents a string.
</P
><P
>Here is some examples of format-string:
</P
><P
CLASS="literallayout"
>%d.)%s<br>
%d.)%s~10<br>
%d.)%s~10~4</P
><P
>The second line represents a format-string with a step parameter. Ten is the step value. 3-rd line is the format-string with the step and with the initial value of the counter. It is equal to 4.
</P
><P
>You can also use %d after %s, i.e. <SPAN
CLASS="emphasis"
><I
CLASS="emphasis"
>%s (%d)</I
></SPAN
> give us a result:
</P
><P
CLASS="literallayout"
>Nirvana (1)<br>
Scorn (2)<br>
Napalm Death (3)<br>
Defecation (4)<br>
Neck (5)<br>
JR Ewing (6)<br>
Fall (7)<br>
Meathook Seed (8)<br>
The Doors (9)<br>
Led Zeppelin (10)</P
><P
><SPAN
CLASS="bold"
><B
CLASS="emphasis"
>Convert tabs to spaces</B
></SPAN
> - be sure to enter the tab size into the Famous text entry before. The value of a tab-size is the number of characters per a one tab.
</P
><P
><SPAN
CLASS="bold"
><B
CLASS="emphasis"
>Convert spaces to tabs</B
></SPAN
> - and now the Famous text entry content = how many spaces to find for replace each of them to the tab.
</P
><P
><SPAN
CLASS="bold"
><B
CLASS="emphasis"
>Reverse</B
></SPAN
> - reverse a text. For example, was <SPAN
CLASS="emphasis"
><I
CLASS="emphasis"
>roxton</I
></SPAN
>, will be <SPAN
CLASS="emphasis"
><I
CLASS="emphasis"
>notxor</I
></SPAN
>.
</P
><P
><SPAN
CLASS="bold"
><B
CLASS="emphasis"
>Antispam e-mail</B
></SPAN
> - makes a selected mailto-link possibly invisible to that damned spammer e-mail harvesters, by converting an address into integer-coded entities. For example, if you will look at the source of that document, so <A
HREF="mailto:tea@list.ru"
TARGET="_top"
>this link</A
> will look like a heap of garbage. I hope that spam harvesters do not understands it. I took an idea from a some issue of <A
HREF="http://linuxgazette.net/"
TARGET="_top"
>LinuxGazette</A
>.
</P
><P
>Remove blank lines - removes blank lines form selected text. I do not think that it is a needful thing, but... Maybe it will be useful to someone.
</P
><P
><SPAN
CLASS="bold"
><B
CLASS="emphasis"
>Remove duplicates</B
></SPAN
> - removes duplicated <SPAN
CLASS="bold"
><B
CLASS="emphasis"
>lines</B
></SPAN
>.
</P
><P
><SPAN
CLASS="bold"
><B
CLASS="emphasis"
>Apply a template to each line</B
></SPAN
> - and again we use the Famous text entry. For example, I want to add br-tag at the end of each line of the selected text. So I type into the entry:
</P
><P
>%s<br>
</P
><P
>And then I apply that function and get br-tag added to the end of each line. In another case, I want to enclose an each line into a pair of li-tags. I type:
</P
><P
><li>%s</li>
</P
><P
>Then I apply the function. So, as you understand, the <SPAN
CLASS="emphasis"
><I
CLASS="emphasis"
>%s</I
></SPAN
> macro = text of the line. And another example:
</P
><P
><a href="%s">%s</a>
</P
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
SUMMARY="Footer navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="x631.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
ACCESSKEY="H"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="x700.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>Numbers</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="c371.html"
ACCESSKEY="U"
>Up</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>Sort</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>
|