Skip to content

Commit 42e5919

Browse files
committed
[Fix][Doc] Fix LocalFile doc (#7887)
Continue to optimize the document about filtering files and add some examples [(#7887)](#7887)
1 parent e64b8a6 commit 42e5919

File tree

1 file changed

+60
-0
lines changed

1 file changed

+60
-0
lines changed

docs/en/connector-v2/source/LocalFile.md

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,10 +256,70 @@ Filter pattern, which used for filtering files.
256256

257257
The filtering format is similar to wildcard matching file names in Linux.
258258

259+
| Wildcard | Meaning | Example |
260+
|--------------|--------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------|
261+
| * | Match 0 or more characters | f* &emsp;&ensp;&emsp; Any file starting with f<br/>b*.txt &emsp; Any file starting with b, any character in the middle, and ending with. txt |
262+
| [] | Match a single character in parentheses | [abc]* &emsp; A file that starts with any one of the characters a, b, or c |
263+
| ? | Match any single character | f?.txt &emsp; Any file starting with 'f' followed by a character and ending with '. txt' |
264+
| [!] | Match any single character not in parentheses | [!abc]* &emsp; Any file that does not start with abc |
265+
| [a-z] | Match any single character from a to z | [a-z]* &emsp; Any file starting with a to z |
266+
| {a,b,c}/a..z | When separated by commas, it represents individual characters<br/>When separated by two dots, represents continuous characters | {a,b,c}* &emsp; Files starting with any character from abc<br/>{a..Z}* &emsp;&ensp; Files starting with any character from a to z |
267+
259268
However, it should be noted that unlike Linux wildcard characters, when encountering file suffixes, the middle dot cannot be omitted.
260269

261270
For example, `abc20241022.csv`, the normal Linux wildcard `abc*` is sufficient, but here we need to use `abc*.*` , Pay attention to a point in the middle.
262271

272+
File Structure Example:
273+
```
274+
report.txt
275+
notes.txt
276+
input.csv
277+
abch20241022.csv
278+
abcw20241022.csv
279+
abcx20241022.csv
280+
abcq20241022.csv
281+
abcg20241022.csv
282+
abcv20241022.csv
283+
abcb20241022.csv
284+
old_data.csv
285+
logo.png
286+
script.sh
287+
helpers.sh
288+
```
289+
Matching Rules Example:
290+
291+
**Example 1**: *Match all .txt files*,Regular Expression:
292+
```
293+
*.txt
294+
```
295+
The result of this example matching is:
296+
```
297+
report.txt
298+
notes.txt
299+
```
300+
**Example 2**: *Match all Any file starting with abc*,Regular Expression:
301+
```
302+
abc*.csv
303+
```
304+
The result of this example matching is:
305+
```
306+
abch20241022.csv
307+
abcw20241022.csv
308+
abcx20241022.csv
309+
abcq20241022.csv
310+
abcg20241022.csv
311+
abcv20241022.csv
312+
abcb20241022.csv
313+
```
314+
**Example 3**: *Match all Any file starting with abc,And the fourth character is either x or g*, the Regular Expression:
315+
```
316+
abc[x,g]*.csv
317+
```
318+
The result of this example matching is:
319+
```
320+
abcx20241022.csv
321+
abcg20241022.csv
322+
```
263323
### compress_codec [string]
264324

265325
The compress codec of files and the details that supported as the following shown:

0 commit comments

Comments
 (0)