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
I am a software developer living in the middle west. My day job is typically with Microsoft development tools, at night I'm a tinkerer, language connoisseur, and wanderer.
24 comments:
just wanted to say thanks for the snippet of SQL code to remove carriage return/line feeds
Thanks, was looking for exactly this.
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,
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!
Perfect!
Do you have any suggestions on how to strip just the trailing CR/LFs?
thank you for your code.
Thanks... This post helped me....
Thanks a million.Instant code.I fixed my code in exactly 5 mts with this Info
Pure Briliance!
Trim leading/trailing characters.
DECLARE @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!!
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 Viagra Buy Viagra
Thanks, this line of code was great - did it exactly what I needed -
Thx,
Jon Bloom
http://www.tampabaybi.com/
Found this helpful. Thanks you.
That was exactly what I have been after.
Thank you !
Thanks!
TQ very much
Thanks!
Thanks, was looking for exactly this! :)
thanks u very much this exactly im looking for..
Life saver, thanks!!
Superb!! Thank yoU!!!
This helped me out quickly, thnx!
Post a Comment