For example I have this text:
line1
line2
line3
...
lineN
I need it to become:
line1=line1
line2=line2
line3=line3
...
lineN=lineN
I use this perl pattern: search ^(.*)$ - replace with $1=$1 (thanks to support team), but I have this:
line1
=line1
line2
=line2
line3
=line3
....
How to join lines by pair?
Duplicate lines
Moderators: DataMystic Support, Moderators, DataMystic Support, Moderators, DataMystic Support, Moderators
-
- Posts: 988
- Joined: Sun Dec 09, 2007 2:49 am
- Location: UK
Check the Perl matching options
Turn off . matches New Line
Last edited by dfhtextpipe on Fri Jan 18, 2008 8:36 pm, edited 1 time in total.
-
- Posts: 988
- Joined: Sun Dec 09, 2007 2:49 am
- Location: UK
Solution found - tested with some random data - this works
Use the copy fields filter, with an equals sign as the custom delimiter....Restrictions
You would need to ensure that the original data does not contain any = characters.
If this is not true, you could choose a different delimiter, one that your data never contains, then use an exact replace filter to change it from that to =.
Code: Select all
TextPipe Single User Edition
Filter Title: Solution
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...
|
|--Copy fields:=-delimited field 1 .. field 1 copy to 2
| Delimiter Type: 5
| Custom delimiter: =
| [ ] Has Header
|
+--Output to file(s)
[ ] Only update date on changed files
[X] Keep original file's date and time
[ ] Append mode
[X] Change extension to: .try.txt
You would need to ensure that the original data does not contain any = characters.
If this is not true, you could choose a different delimiter, one that your data never contains, then use an exact replace filter to change it from that to =.