Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
using the function Subfield to separate fields I have problems when there is a ',' inside a field.
In fact it cut all the characters after ','
for example if a field has the text "47,25 for each meter" instead of loading "47,25 for each meter" it only load "47"
I tried changing:
SET ThousandSep='.';
SET DecimalSep=',';
SET MoneyThousandSep='.';
SET MoneyDecimalSep=',';
but it does not work
I think I need a funtion to make consider the total content of the function subfield as text
something like:
funtionconsiderastext (subfield(@1,';',10)) as okfield
thanks for your help
It will be great if you can provide 10 lines of data, so that I can try it out. But in the mean while based on your reply I created a text file and named it as sampledata.txt and the data in that file is as below:
Prod,code
A,47,25 for each meter
B,50,50 for each meter
Now in the edit script I used file wizard and selected fixed record as shown below:
Once I clicked 'Finish", I get the following code generated:
LOAD [@1:1] as product,
[@2:2] as dummy,
[@3:n] as code
FROM
[C:\Users\mm\Desktop\sampledata.txt]
(fix, codepage is 28591, embedded labels);
Then I am able to create a chart as below (Where you can see the comma in the code field):
Note: If you have ';' instead of ',' I think it will still work.
Give a try and see if that helps or please provide some 10 lines of sample data.
One way of doing this is adding double quotes. See a sample below:
temp:
Load * Inline [
Prod,code
A,"47,25 for each meter"
B,"50,50 for each meter"
];
Hope this helps..
Thanks Raja but the problem is that que data not comes from a load in line , comes from a ordinary load in which there are a log field called @1 , inside this field there are several subfields separated by a delimiter ";".
When I use the funtion Subfield, if there is a ',' inside one of the subfields I lose all the charactes after the ','.
It will be great if you can provide 10 lines of data, so that I can try it out. But in the mean while based on your reply I created a text file and named it as sampledata.txt and the data in that file is as below:
Prod,code
A,47,25 for each meter
B,50,50 for each meter
Now in the edit script I used file wizard and selected fixed record as shown below:
Once I clicked 'Finish", I get the following code generated:
LOAD [@1:1] as product,
[@2:2] as dummy,
[@3:n] as code
FROM
[C:\Users\mm\Desktop\sampledata.txt]
(fix, codepage is 28591, embedded labels);
Then I am able to create a chart as below (Where you can see the comma in the code field):
Note: If you have ';' instead of ',' I think it will still work.
Give a try and see if that helps or please provide some 10 lines of sample data.
Many thanks for your explanation , the use of 'fixed record' is the solution I was looking for.
Great and glad able to help... Have a nice day...