Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

UTF8 encoding in file extract without the BOM header

Avatar

Avatar
Validate 1
Level 2
anasso83525035
Level 2

Likes

6 likes

Total Posts

30 posts

Correct Reply

6 solutions
Top badges earned
Validate 1
Give Back 3
Give Back
Boost 5
Boost 3
View profile

Avatar
Validate 1
Level 2
anasso83525035
Level 2

Likes

6 likes

Total Posts

30 posts

Correct Reply

6 solutions
Top badges earned
Validate 1
Give Back 3
Give Back
Boost 5
Boost 3
View profile
anasso83525035
Level 2

12-11-2020

Hello,

 

I'm having an issue with a csv file extraction. The need is to have it encoded in UTF8 but ACC adds the byte order mark at the begining of the file.

 

Any idea how to get simple UTF8 extraction or remove the BOM please ?

 

Thank you.

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Validate 1
MVP
Darren_Bowers
MVP

Likes

74 likes

Total Posts

252 posts

Correct Reply

81 solutions
Top badges earned
Validate 1
Affirm 50
Establish
Give Back 3
Applaud 25
View profile

Avatar
Validate 1
MVP
Darren_Bowers
MVP

Likes

74 likes

Total Posts

252 posts

Correct Reply

81 solutions
Top badges earned
Validate 1
Affirm 50
Establish
Give Back 3
Applaud 25
View profile
Darren_Bowers
MVP

12-11-2020

Hi @anasso83525035 - you can get the resulting file name from the CSV extraction activity and run some Javascript to execCommand() some command line sed functions to do this (provided your host is Linux)

https://docs.adobe.com/content/help/en/campaign-classic/technicalresources/api/f-execCommand.html

https://unix.stackexchange.com/a/381263

Cheers

Darren

Answers (1)

Answers (1)

Avatar

Avatar
Validate 1
Level 2
anasso83525035
Level 2

Likes

6 likes

Total Posts

30 posts

Correct Reply

6 solutions
Top badges earned
Validate 1
Give Back 3
Give Back
Boost 5
Boost 3
View profile

Avatar
Validate 1
Level 2
anasso83525035
Level 2

Likes

6 likes

Total Posts

30 posts

Correct Reply

6 solutions
Top badges earned
Validate 1
Give Back 3
Give Back
Boost 5
Boost 3
View profile
anasso83525035
Level 2

16-11-2020

Hello @Darren_Bowers 

 

Thanks for the answer, I have been trying to implement that, but still get the following error :

 

-53
sudo: a password is required

 

Can you please tell me if my CMD command is constructed correctly :

 

//instance.vars.fileToSend is the complete path to the file extracted in the activity before

var CMD = '"'+"sed -i '1s/\xEF\xBB\xBF//' "+instance.vars.fileToSend+'"'

logInfo('command remove bom ===>'+CMD);
var res =execCommand(CMD,true);

instance.vars.retour = res[0];

logInfo('Code retour commande : ' + res[0]);

logInfo('Résultat commande : ' + res[1]);

logInfo('Fin');

Thank you.