I have a flat file with multiple lines that belong to one person account and i need to bring all lines to one line making them as one line of comma separate type data. For example as below: DateIn" 2007/01/01 account:155555 name" john smith Age: 18 -------- DateIn" 2007/01/01 account:166665 name" josh sammy Age: 20
With this example, how can i join the 2 lines to one line then i join the final 2 lines in one line. By the way, i have been trying to work on this in my sql server 2000.
Thanks for your help my boyfriend was having many problems with that last week so when I saw your blog I called him immediately and even he pay for it to a technician we never imagine that it was so easy. Viagra Online Generic ViagraBuy Viagra
just wanted to say thanks for the snippet of SQL code to remove carriage return/line feeds
ReplyDeleteThanks, was looking for exactly this.
ReplyDeleteI have a flat file with multiple lines that belong to one person account and i need to bring all lines to one line making them as one line of comma separate type data. For example as below:
ReplyDeleteDateIn" 2007/01/01 account:155555
name" john smith Age: 18
--------
DateIn" 2007/01/01 account:166665
name" josh sammy Age: 20
With this example, how can i join the 2 lines to one line then i join the final 2 lines in one line. By the way, i have been trying to work on this in my sql server 2000.
Thanks,
ME2007.
Thank you so much! This is exactly what I was looking for - and so much more simple than everything else I found out there. Nice job!
ReplyDeletePerfect!
ReplyDeleteDo you have any suggestions on how to strip just the trailing CR/LFs?
ReplyDeletethank you for your code.
ReplyDeleteThanks... This post helped me....
ReplyDeleteThanks a million.Instant code.I fixed my code in exactly 5 mts with this Info
ReplyDeletePure Briliance!
ReplyDeleteTrim leading/trailing characters.
ReplyDeleteDECLARE @value VARCHAR(1000)
DECLARE @pat varchar(10)
SET @pat = '%[^ ' + char(09) + char(10) + ']%'
SET @value = CHAR(10) + ' ' + CHAR(10) + 'message test ' + char(10) + ' values ' + CHAR(10) + ' ' + CHAR(10) + CHAR(10) + ' ' + CHAR(10)
SELECT SUBSTRING(
@value,
PATINDEX(@pat, @value),
LEN(@value) - PATINDEX(@pat, @value) - PATINDEX(@pat, REVERSE(@value)) + 2)
Excellent - googled it and in 20 seconds had a working app!!
ReplyDeleteThanks for your help my boyfriend was having many problems with that last week so when I saw your blog I called him immediately and even he pay for it to a technician we never imagine that it was so easy. Viagra Online
ReplyDeleteGeneric Viagra Buy Viagra
Thanks, this line of code was great - did it exactly what I needed -
ReplyDeleteThx,
Jon Bloom
http://www.tampabaybi.com/
Found this helpful. Thanks you.
ReplyDeleteThat was exactly what I have been after.
ReplyDeleteThank you !
Thanks!
ReplyDeleteTQ very much
ReplyDeleteThanks!
ReplyDeleteThanks, was looking for exactly this! :)
ReplyDeletethanks u very much this exactly im looking for..
ReplyDeleteLife saver, thanks!!
ReplyDeleteSuperb!! Thank yoU!!!
ReplyDeleteThis helped me out quickly, thnx!
ReplyDelete