hiteksoftware.com Forum Index hiteksoftware.com
User discussion forum
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Replace with Carriage Return

 
Post new topic   Reply to topic    hiteksoftware.com Forum Index -> Other
View previous topic :: View next topic  
Author Message
jmaples



Joined: 07 Aug 2008
Posts: 4

PostPosted: Thu Aug 07, 2008 9:09 am    Post subject: Replace with Carriage Return Reply with quote

I am using an SQL Query Task to read a single line from an MS Access database and returning the values to a text file. The values in the text file are TAB separated. I am looking for a way to put each value on a line by itself. I am thinking I could use a Text Search Task to do this. I can find the TABs using the Search Terms (\t), however, I don't know what to put on the Replace Terms line to change the TABs to Carriage Returns or Line Feeds.

Any sugestions would be appreciated.
Back to top
View user's profile Send private message
Robert
Site Admin


Joined: 25 May 2006
Posts: 1140

PostPosted: Thu Aug 07, 2008 11:04 am    Post subject: Reply with quote

New line is different on unix and windows systems.
\n for unix, i.e. line feed only
\r\n for windows , i.e. carriage return + line feed
Back to top
View user's profile Send private message
jmaples



Joined: 07 Aug 2008
Posts: 4

PostPosted: Thu Aug 07, 2008 11:18 am    Post subject: Reply with quote

That's waht I had tried. What I get is the letters 'rn' in place if the TABs instead of new lines. Does the 'Replace Term(s)' field accept Regex? Does it require dfifferent formatting/

Thanks for your help.
Back to top
View user's profile Send private message
Robert
Site Admin


Joined: 25 May 2006
Posts: 1140

PostPosted: Thu Aug 07, 2008 11:52 am    Post subject: Reply with quote

yes, all the replace/rename code in the software uses regex.

the \ would probably need to be escaped with a \
so try
\\r\\n
Back to top
View user's profile Send private message
jmaples



Joined: 07 Aug 2008
Posts: 4

PostPosted: Thu Aug 07, 2008 12:40 pm    Post subject: Reply with quote

Thanks for the reply. Still no luck though.

When I enter \\r\\n in the Replace Term(s) field I get \r\n as a replacement for each TAB.
Back to top
View user's profile Send private message
jmaples



Joined: 07 Aug 2008
Posts: 4

PostPosted: Sat Aug 09, 2008 12:23 pm    Post subject: Reply with quote

While I have not been able to get the Carriage Return\Line Feed to work on the Replace Terms field, I backed up a step and solved my problem by inserting 'Chr(13)+Chr(10),' between each field in my SQL statement. I never knew this was possible but it works.

Thanks.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    hiteksoftware.com Forum Index -> Other All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group