Split to values

Iron Contributor

Dear Experts,

                   I have a txt file m whose structure is like this:-

tci-StateId x,
bwp-Id 0,
referenceSignal Signal: y,   (Signal can be ssb or csi-rs)
qcl-Type typez( z = A or C)


And , with some manual work, I created below table out of it..


Can you please help, if with PQ, we can do this?


Thanks in Advance,




7 Replies



Try this Go script for reference.

Rename the attached from .xlsx to .zip and unzip it.

package main

import (

func main() {
	// Read the input file
	data, err := ioutil.ReadFile("pdsch_config_setup.txt")
	if err != nil {
		fmt.Println("Error reading file:", err)

	// Extract relevant information using regular expressions
	//regex := regexp.MustCompile(`tci-StateId (\d+),.*?csi-rs : (\d+),.*?qcl-Type (\w+)`)
	//regex :=regexp.MustCompile(`tci-StateId (\d+),[\s\S]*?csi-rs : (\d+),[\s\S]*?qcl-Type (\w+)`)
	regex :=regexp.MustCompile(`tci-StateId (\d+),[\s\S]*?(csi-rs|ssb) : (\d+),[\s\S]*?qcl-Type (\w+)`)
	matches := regex.FindAllStringSubmatch(string(data), -1)

	// Open the output CSV file
	file, err := os.Create("output.csv")
	if err != nil {
		fmt.Println("Error creating file:", err)
	defer file.Close()

	writer := csv.NewWriter(file)
	defer writer.Flush()

	// Write the header row
	header := []string{"tci-StateId", "referenceSignal csi-rs", "qcl-Type", "referenceSignal", "referenceSignal Id"}
	err = writer.Write(header)
	if err != nil {
		fmt.Println("Error writing header:", err)

	// Write the data rows
//	for index, match := range matches {
	for _, match := range matches {
		tciStateId, _ := strconv.Atoi(match[1])
		referenceSignal, _ := strconv.Atoi(match[3])
		qclType := match[4]

		row := []string{
		err = writer.Write(row)
		if err != nil {
			fmt.Println("Error writing data:", err)

	fmt.Println("CSV file created successfully.")


Thanks @peiyezhu , but as mentioned earlier, I am not a coder , looking for something in Power Query, with the Power Editor steps to achieve this.





Thanks for your response.
Yes,I see.
As part of brain storm in this forum,I just provide it for reference rather than standard answer.
I guess PQ here may need regular expression too.
So,maybe help to some PQ expert.

On the other hand,here I guess you also need codes with M language (https://powerquery.how/#:~:text=The%20M%20language%20Power%20Query%20M%2C%20a%20language,the%20Power....) rather than only click and drag drop.

Thanks@peiyezhu , in general if I have to learn only one Language for Data-manipulation and cleaning(ETL), then what it should be python or php? I heard python is more easier and lesser code lines than other languages..




Yes. Python is a great option which has many resources.
If you use the codes for yourself,I recommend Python.
Go,C# and php also great.
php is easy to start and good at web program.
Go,C# dotnet for desktop and can be compiled to Exe.

Hi @anupambit1797 


Update the path (in the Source step) to the text file in the attached query and if your actual file is as consistent as the one you shared that should work...