How to convert this data?
Moderators: DataMystic Support, Moderators, DataMystic Support, Moderators, DataMystic Support, Moderators
- DataMystic Support
- Site Admin
- Posts: 2227
- Joined: Mon Jun 30, 2003 12:32 pm
- Location: Melbourne, Australia
- Contact:
Re: How to converting this data?
Try this perl pattern:
\[(\w+)\]([^\]]*)\[/\1\]
Replace with
$2|
\[(\w+)\]([^\]]*)\[/\1\]
Replace with
$2|
Re: How to convert this data?
============SIMPLE DATA BEGIN============
aaa|ccc|eee|fff|ggg|
============SIMPLE DATA END==============
OK but... where is my parameter "B" and "D"?
I'll would like to have this...
============SIMPLE DATA BEGIN============
aaa||ccc||eee|fff|ggg
============SIMPLE DATA END==============
I have this right now, it is possible to optimize that filters some how? Because I wrote some kind of crazy method right now I thing
Download this example: http://plikojad.pl/bbl3izxt0ipw
aaa|ccc|eee|fff|ggg|
============SIMPLE DATA END==============
OK but... where is my parameter "B" and "D"?
I'll would like to have this...
============SIMPLE DATA BEGIN============
aaa||ccc||eee|fff|ggg
============SIMPLE DATA END==============
I have this right now, it is possible to optimize that filters some how? Because I wrote some kind of crazy method right now I thing
Code: Select all
TextPipe
Filter Title: D:\dokumenty\FILTRY\przyklad_luki.fll
Filter List
-----------
Filter options
| [ ] Log to file
| [X] Append to logfile
| Log filename: textpipe.log
| Threshold 500
|
|--Input from file(s)
| [ ] Confirm before processing each file
| [ ] Confirm before processing read/only files
| [ ] Delete input files after processing
| Process binary files
|
|--Comment...
| | TEST
| |
| +--Perl pattern [^============SIMPLE DATA BEGIN============(.*)============SIMPLE DATA END============] with [$1]
| | [ ] Match case
| | [ ] Whole words only
| | [ ] Case sensitive replace
| | [ ] Prompt on replace
| | [ ] Skip prompt if identical
| | [ ] First only
| | [ ] Extract matches
| | Maximum text buffer size 4096
| | [ ] Maximum match (greedy)
| | [ ] Allow comments
| | [X] '.' matches newline
| | [X] UTF-8 Support
| |
| +--Convert End of Lines - Auto to None
| [X] Remove bad EOL
|
|--Comment...
| | We fill the missing gaps (PSEUDO TAGS)
| |
| | [/END_PSEUDO_TAG]
| | (insert missing pseudo tag)
| | [BEGIN_PSEUDO_TAG]
| |
| +--Perl pattern [(\[/a\]\[something_c\]|\[/something_c\]\[e\])] with [||]
| [ ] Match case
| [ ] Whole words only
| [ ] Case sensitive replace
| [ ] Prompt on replace
| [ ] Skip prompt if identical
| [ ] First only
| [ ] Extract matches
| Maximum text buffer size 4096
| [ ] Maximum match (greedy)
| [ ] Allow comments
| [X] '.' matches newline
| [X] UTF-8 Support
|
|--Comment...
| | Clean TAGS
| |
| |--Perl pattern [\[(b|c|something_c|d|e|f|more_f|g)\]] with [|]
| | [ ] Match case
| | [ ] Whole words only
| | [ ] Case sensitive replace
| | [ ] Prompt on replace
| | [ ] Skip prompt if identical
| | [ ] First only
| | [ ] Extract matches
| | Maximum text buffer size 4096
| | [ ] Maximum match (greedy)
| | [ ] Allow comments
| | [X] '.' matches newline
| | [X] UTF-8 Support
| |
| |--Perl pattern [\[/\w+\]] with []
| | [ ] Match case
| | [ ] Whole words only
| | [ ] Case sensitive replace
| | [ ] Prompt on replace
| | [ ] Skip prompt if identical
| | [ ] First only
| | [ ] Extract matches
| | Maximum text buffer size 4096
| | [ ] Maximum match (greedy)
| | [ ] Allow comments
| | [X] '.' matches newline
| | [X] UTF-8 Support
| |
| +--Replace [[a]] with []
| [ ] Match case
| [ ] Whole words only
| [ ] Case sensitive replace
| [ ] Prompt on replace
| [ ] Skip prompt if identical
| [ ] First only
| [ ] Extract matches
|
+--Output to file(s)
[ ] Only update date on changed files
[X] Keep original file's date and time
[ ] Append mode
[ ] Change extension to: .txt
Backup mode
Files List
----------
Last edited by Fixer on Thu Jul 31, 2008 11:35 am, edited 2 times in total.
- DataMystic Support
- Site Admin
- Posts: 2227
- Joined: Mon Jun 30, 2003 12:32 pm
- Location: Melbourne, Australia
- Contact:
Re: How to converting this data?
Sorry, make the perl pattern:
\[(\w+)\]([^\]]*)\[/\1\]\r\n
If you need to add a newline after the ggg field, search for '|====' and add in a newline.
What do you mean by 'parameter "B" and "D"?' You didn't provide one.
This filter:
Takes this:
and converts it to this:
\[(\w+)\]([^\]]*)\[/\1\]\r\n
If you need to add a newline after the ggg field, search for '|====' and add in a newline.
What do you mean by 'parameter "B" and "D"?' You didn't provide one.
This filter:
Code: Select all
|--Perl pattern [\[(\w+)\]([^\]]*)\[/\1\]\r\n] with [$2|]
| [ ] Match case
| [ ] Whole words only
| [ ] Case sensitive replace
| [X] Prompt on replace
| [ ] Skip prompt if identical
| [ ] First only
| [ ] Extract matches
| Maximum text buffer size 4096
| [ ] Maximum match (greedy)
| [ ] Allow comments
| [X] '.' matches newline
| [ ] UTF-8 Support
Code: Select all
============SIMPLE DATA BEGIN============
[a]aaa[/a]
[something_c]ccc[/something_c]
[e]eee[/e]
[more_f]fff[/more_f]
[g]ggg[/g]
============SIMPLE DATA END============
Code: Select all
============SIMPLE DATA BEGIN============
aaa|ccc|eee|fff|ggg|============SIMPLE DATA END============
Re: How to convert this data?
oh sorry... my mistake I did not explainDataMystic Support wrote: What do you mean by 'parameter "B" and "D"?' You didn't provide one.
Ok so maby i explain whith other more real example:
============SIMPLE FILM_1 BEGIN============
[title]some title 1[/title]
[alternative_title]some alternative title 1[/alternative_title]
[director]some director 1[/director]
============SIMPLE FILM_1 END============
============SIMPLE FILM_2 BEGIN============
[title]some title 2[/title]
[director]some director 2[/director]
============SIMPLE FILM_2 END============
And "the end" rezult:
============SIMPLE FILM_1 BEGIN============
some title 1|some alternative title 1|some director 1
============SIMPLE FILM_1 END============
============SIMPLE FILM_1 BEGIN============
some title 2||some director 2
============SIMPLE FILM_1 END============
As we see some times "film data" don't have "alternative_title" column.
In database I have 3 columns so i need some like this "||" (this is the blanc parameter "B")
I hope that you know about what I speak
PS I am pleased very much, that you want you to help me.
- DataMystic Support
- Site Admin
- Posts: 2227
- Joined: Mon Jun 30, 2003 12:32 pm
- Location: Melbourne, Australia
- Contact:
Re: How to convert this data?
Then use an EasyPattern (not perl pattern) like this:
Code: Select all
[
'[title]', capture(1+ chars), '[/title]', 0+ chars,
longest optional( '[alternative_title]', capture(1+ chars), '[/alternative_title]', 0+ chars, )
'[director]', capture(1+ chars), '[/director]'
]
Re: How to convert this data?
first I have little problem with implementation but now its works good
THX
THX
- DataMystic Support
- Site Admin
- Posts: 2227
- Joined: Mon Jun 30, 2003 12:32 pm
- Location: Melbourne, Australia
- Contact:
Re: How to convert this data?
Great - will you be purchasing soon?
Re: How to convert this data?
I wonder over this, I testing right now TextPipe Trial...
Yours application and help support are great.
Yours application and help support are great.
- DataMystic Support
- Site Admin
- Posts: 2227
- Joined: Mon Jun 30, 2003 12:32 pm
- Location: Melbourne, Australia
- Contact:
Re: How to convert this data?
Thank you!
- DataMystic Support
- Site Admin
- Posts: 2227
- Joined: Mon Jun 30, 2003 12:32 pm
- Location: Melbourne, Australia
- Contact:
Re: How to convert this data?
Where are parameters B and D? What perl pattern did you try?