Search and Replace
online data conversion help
|
Back to: iConv |
|
| |
This immensely powerful function searches each line of your file for a
pattern, and if found, replaces that pattern with the replacement
match for those lines that are not excluded using a regular expression
match in the 'Unknown' field. The substitution pattern follows the perl regular expression syntax. For
complete details, check out the
perlre
documentation.
Examples:
| Pattern |
Replacement |
Result |
| ^\r\n |
|
Remove empty lines from windows file |
| \bgreen\b |
mauve |
change 'green', but don't change
'wintergreen' |
| /usr/bin |
/usr/local/bin |
change path |
| xxx |
yyyyyyy |
change all xxx to yyy |
| $ |
Z |
Add a 'Z' to every line |
| ^\s*(.*?)\s*$ |
$1 |
trim white space |
| \t |
| |
change tab into pipe symbol |
| ([^ ]*) *([^ ]*) |
$2 $1 |
reverse 1st two fields |
|
Q: How do I create a tab-delimited address file from a Word label document.
- Save the Word document with the labels as a normal .txt text file (use 'File
- Save As', and choose the 'Insert line breaks' option). This will give you a
text file with the label fields each on a separate line, and an empty line
separating the individual labels.
- Use the online search and replace data conversion to replace the newlines separating the fields by tabs,
but leave the record separating empty line untouched. This is easily accomplished using a
pattern of \r\n, replacement of \t and unless of
^\r\n
The result will be a tab-separated file with one label per line, with
the fields separated by a tab. |
Data Conversion Home
Help
Contact us
Link to us
Rate This Page
Copyright ©2005 iConv.com. All
rights reserved.
|
|
|