I have a CSV file of Tasks (activity) to upload. As it can be seen from the picture below that the line breaks are occurring, how can I format such a file in excel, because the data loader or any CSV tool will see the line break a new row / record in the CSV.
-
2en.wikipedia.org/wiki/Comma-separated_values in Basic Rules section there is written about what should be input format for that -- add wrapping ""– kurunveMar 14, 2016 at 10:08
-
That I knew, but there are thousands of records. How do you expect to resolve that?– MahmoodMar 14, 2016 at 10:28
-
on creation or on parsing or what do you mean?– kurunveMar 14, 2016 at 10:43
-
These files are being generated by the client, and so we just gonna have them in this shape. Now, from here I need to load this data in to salesforce using data loader offcourse. I hope the scenario is clear now.– MahmoodMar 14, 2016 at 10:50
-
2Then you have a problem, because basically you can not be 100% sure that you can parse that correct way (of course my mind just draw me few weird case scenario, that have low probability to happen in real life). I would recommend you to do split by end of the line first, and then count amount of column separator per row. As long as amount is less than amount of rows -- then just pick next line and append it to current row, and do it as long as you get amount of cells as you need, or as long as next column would satisfy some criteria (reg ext of number -- that mean new row started). Good luck!– kurunveMar 14, 2016 at 11:24
1 Answer
Data source has line breaks, but I want to import those through Data Loader.
- Export the data but change the Char(10), Char(13) values to a unique text value like "!!!" with a replace function: ie Replace (Textfield, CHAR(10), '!!!"). This will remove the line breaks, but put place holders in place instead.
- Import the Data into Exel.
- On that column, do a Find Replace: Find: !!! Replace: "CtRL" + "J". This will put line breaks in your field, but will keep the text together.
- Save as CSV and Import via Data Loader.