473,405 Members | 2,421 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

format string from given pattern

hi everyone,

i am trying to write postgresql query for below scenario:

inputs :
1. alphanumeric string e.g. abcd1234efgh
2. pattern e.g. [1][2][3][2][1][3]
3. delimiter e.g - (hyphen)

output : a-bc-d12-34-e-fgh

i require query. function wont work for me.

any help is welcome.

thanks
Mar 16 '13 #1
1 1917
Rabbit
12,516 Expert Mod 8TB
If you are saying that the pattern and delimiter won't change. You can use a series of substrings to get the output. If, however, it is variable, you will have to use a function, I don't see any way around that.
Mar 18 '13 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: kevininstructor | last post by:
The following was copied from a web site for learning formatting. Dim myInt As Integer = 100 Dim FormatPrice As String = String.Format("Price = |{0,10:c }|", myInt) Console.WriteLine(FormatPrice)...
6
by: Servé Lau | last post by:
suppose I want to use sscanf get the functionname from a function prototype. Is the following format string correct then? char funcname; char *p = "func(void)"; sscanf(p, "%s", funcname);...
6
by: Donal McWeeney | last post by:
Hi, Is there a way to specify on the predefined format strings like P and N that you want displayed all the decimals in the number... for example 3 will display 3 2.1 will display 2.1...
2
by: MM | last post by:
Hi, I have a param class containg these vars:- string key; // eg: "WN" object value; // eg: 1.2 string format; // eg "F2" and I output these to a StreamWriter using ...
7
by: Eddy Soeparmin | last post by:
Hi, I need to display a DateTime field in 'mm/dd/yyyy' in a DataGrid.. On myGrid1 - Properties - Columns - myColumn1 - Text format string: I tried to put 'mm/dd/yyyy' in there and it displays...
4
by: James | last post by:
vb.net 2003 i used console.writeline to output to screen. eg console.writeline ("test1 : " & vbtab & v_test1) console.writeline ("test2 : " & vbtab & v_test2) etc etc result becomes
3
by: stathisgotsis | last post by:
Hello everyone, Trusting K&R2 i thought until recently that spaces are ignored in scanf's format string. Reading arguments to the contrary confused me a little. So i now ask: Is...
7
by: moondaddy | last post by:
I need to format a string to it always has 2 digits in it. I'm getting the month like this: DateTime.Now.Month.ToString() Right now since it's August, this returns a string of "8", however, I...
7
by: Andrus | last post by:
How to create format string for decimal data type which shows blank for zero and default format otherwize ? I tried format string "f;f;#" but this shows f for nonzero numbers. Andrus. ...
3
by: Fuugie | last post by:
Is there an easier way to reverse a given pattern than the way I have coded it? Example of the program: Enter a DNA sequence: CGATTGAATTACAAGTCCAATT Enter the pattern: TGAA Mutated DNA...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.