I would like to know whether TextPipe can do the following:
Given files //path1/aaa.txt, //path2/bbb.txt and //path3/ccc.txt (all in different folders, indicated by //path1..n), and an Excel spreadsheet with the following data:
-----------------------------------------
//path1/aaa.txt | a1
-----------------------------------------
//path2/bbb.txt | b2
-----------------------------------------
//path3/ccc.txt | c3
-----------------------------------------
[| represents column separator.]
I need to insert the value contained in column B, into the corresponding file contained in column A at the position where it matches a fixed pattern xxx. Can TextPipe insert the data into the files in one go?
Replace using Filename
Moderators: DataMystic Support, Moderators, DataMystic Support, Moderators, DataMystic Support, Moderators
You can accomplish your goal w/ a single batch file....
hmmmm...Since you want to use a unique replaced string on a pattern that is fixed across separate files, the only way I can imagine you could get from A-to-B in one go is by setting up a batch file.... If you use the below string, making only adjustments for:
1. Path to your textpipe.exe
2. /S0=XXX (your search string)
3. /R=a1 (your replace string)
*save .txt file at .bat, double click, and stand back while tpp does its thing, this should get there fine.
you can setup the string in excel very easily with this simple formula:
A1-#=//path#/file.txt
B1-#=replace_string
Formula:
C="""c:\program files\textpipe\textpipe.exe"""&" /Minimized /BS /S0=XXX /R="&B1&" /N- /T-"&" """&A1&""""&" /g /q"
Here is the actual switch that should go into the batch file.
"c:\program files\textpipe\textpipe.exe" /Minimized /BS /S0=XXX /R=a1 /N- /T- "//path1/aaa.txt" /g /q
"c:\program files\textpipe\textpipe.exe" /Minimized /BS /S0=XXX /R=b2 /N- /T- "//path2/bbb.txt" /g /q
"c:\program files\textpipe\textpipe.exe" /Minimized /BS /S0=XXX /R=c3 /N- /T- "//path2/bbb.txt" /g /q
etc.
etc...
etc.....
good-luck!
J-
1. Path to your textpipe.exe
2. /S0=XXX (your search string)
3. /R=a1 (your replace string)
*save .txt file at .bat, double click, and stand back while tpp does its thing, this should get there fine.
you can setup the string in excel very easily with this simple formula:
A1-#=//path#/file.txt
B1-#=replace_string
Formula:
C="""c:\program files\textpipe\textpipe.exe"""&" /Minimized /BS /S0=XXX /R="&B1&" /N- /T-"&" """&A1&""""&" /g /q"
Here is the actual switch that should go into the batch file.
"c:\program files\textpipe\textpipe.exe" /Minimized /BS /S0=XXX /R=a1 /N- /T- "//path1/aaa.txt" /g /q
"c:\program files\textpipe\textpipe.exe" /Minimized /BS /S0=XXX /R=b2 /N- /T- "//path2/bbb.txt" /g /q
"c:\program files\textpipe\textpipe.exe" /Minimized /BS /S0=XXX /R=c3 /N- /T- "//path2/bbb.txt" /g /q
etc.
etc...
etc.....
good-luck!
J-
quotes in replace string
What if my replace string contains both spaces and quotes? How would I express this in the command line syntax?
Will the following work? (Note the replace string is "var foo = "bar";").
"C:\Program Files\TextPipe\TextPipe.exe" /Minimized /BS /S0="xxx" /R="var foo = "bar";" /N- /T-"/my/docs/doc1.txt" /g /q
Thanks a 10^9 in advance.
Will the following work? (Note the replace string is "var foo = "bar";").
"C:\Program Files\TextPipe\TextPipe.exe" /Minimized /BS /S0="xxx" /R="var foo = "bar";" /N- /T-"/my/docs/doc1.txt" /g /q
Thanks a 10^9 in advance.
- DataMystic Support
- Site Admin
- Posts: 2227
- Joined: Mon Jun 30, 2003 12:32 pm
- Location: Melbourne, Australia
- Contact:
quotes
"C:\Program Files\TextPipe\textpipe.exe" /Minimized "/S0=brown fox" "/R=purple "mink"" /N- /T- "\pathname\filename.txt" /g /q
didn't work. The resultant document does not display the word "mink" in (double) quotes. Thankfully the programming language I'm using recognises single quotes as well. This works:
"C:\Program Files\TextPipe\textpipe.exe" /Minimized "/S0=brown fox" "/R=purple 'mink'" /N- /T- "\pathname\filename.txt" /g /q
Cheers
mowgli
didn't work. The resultant document does not display the word "mink" in (double) quotes. Thankfully the programming language I'm using recognises single quotes as well. This works:
"C:\Program Files\TextPipe\textpipe.exe" /Minimized "/S0=brown fox" "/R=purple 'mink'" /N- /T- "\pathname\filename.txt" /g /q
Cheers
mowgli
- DataMystic Support
- Site Admin
- Posts: 2227
- Joined: Mon Jun 30, 2003 12:32 pm
- Location: Melbourne, Australia
- Contact: