Help: line breaks issue in csv file from list processing

benny117

Новичок
Регистрация
07.04.2020
Сообщения
3
Благодарностей
0
Баллы
1
Hello Guys,

I struggling since many days with filling a csv file with data,

I'm scrapping product pages which contains product description in HTML.
I'm using a DOM+regex to extract the test that i need,
Then i'm using a list processing ( add line ) ( "Variable1";"Variable2";"Variable3") to create my csv file,

My issue is that (not always, but most the time), the csv file is a mess, i get many line breaks, the HTML text that i put in a variable should be in only 1 cell.
But sometime it is divided in many cells(rows).

i used some text processing to remove spaces, line breaks...
i even used a custom C# code to remove the HTML tags.
but nothing avoid this issue at 100%


I wish anyone who face this could help me

Thanks a lot
 

benny117

Новичок
Регистрация
07.04.2020
Сообщения
3
Благодарностей
0
Баллы
1
coudlnt find how to edit previous post sorry :

here are more inofrmation :


Custom C# code : return Regex.Replace(project.Variables["variable"].Value, "<.*?>", String.Empty);
 

lokiys

Moderator
Регистрация
01.02.2012
Сообщения
4 768
Благодарностей
1 179
Баллы
113
Hi, CSV is a table, so you first have to use tables, https://zennolab.com/wiki/en:table
Another way if you save any HTML text with coma in CSV file and your table separator is coma, then it won't be saved correctly in the table at the end, because you know, coma is treated as a separator.
Plus you have to use correct way for saving data in tables and its {-String.Tab-}
 
  • Спасибо
Реакции: benny117

benny117

Новичок
Регистрация
07.04.2020
Сообщения
3
Благодарностей
0
Баллы
1
Hi Lokiys,

Thanks a lot for your reply,

You the Man, this {-String.Tab-} is a game changer !=)

I made a table processing with : {-Variable-}{-String.Tab-}{-Variable-} , to table with {-String.Tab-} as separator

i'm not totaly sure of what i have done , but it worked, i finnaly created a xlsx file exactly how i wanted it.

Many thanks

Ben
 

Кто просматривает тему: (Всего: 1, Пользователи: 0, Гости: 1)