javascript - 有没有办法从 csv 中获取文本格式?

标签 javascript php html css csv

我每天早上 5:19 自动获取我们库存的 csv。对于 csv 的其中一个值,有大量相关产品的描述;该产品是我们经销商的车辆。在输入 csv 之前,描述是用回车、空格、特殊字符等编写的,以某种方式进行格式化。

我可以尝试设置它,以便当我的 php 文件更新我的 sql 数据库时,它会向描述文本添加 html 标签。但我宁愿不必那样做。

有没有办法从 csv 中获取那些“基于文本”的格式选择?

这是我们库存中的一种产品的示例:

"1HDIPLF115Y950778","U","10861","Harley-Davidson","SCREAMIN EAGLE FAT BOY","2005","SCREAMIN EAGLE","Motorcycles & Scooters","9198","","Unspecified","Gasoline","Manual 5-Speed","14700","Blue","","","It's called a Fat Boy but you certainly don't have to be to own one. It's also a Hog. Why all the obese names for this bike? It's stripped down and ready to barrel down the highway. We have an incredibly striking 2005 Harley Davidson Screamin' Eagle Fat Boy. It features a 1690cc pushrod V-twin 4 stroke (upgraded from the standard 88B engine on the regular Fat Boy), electronic ignition with key fob, electric starting system, 5 speed transmission, belt drive, 5.0 gallon tank, front and rear disc brakes. The Screamin' Eagle package includes a lowered rear suspension, flying teardrop shaped air cleaner cover, slash down pipes, chin spoiler pan-style seat with a decorative chrome pillion. The tank and fenders are accented by metal grind streaks of exposed steel. A Stage 1 air cleaner kit is paired with the fuel injectors with a heavy duty starter and hydraulically controlled clutch have been added as well. This Fat Boy is a One Owner and was over 28 grand when it was purchased brand new! For half the price, you get a practically new Harley. This one is ready to ride since you live to ride. So c'mon, put down the barbecued pork and hop on this hog. We promise it has a better bite! Arizona Specialty Motors 1625 E Weber Drive Tempe 85281 480-454-3844 arizonaspecialtymotors.com Our mission is simple, we want to make this your best car buying experience ever. Taking care of customers is our business. We are a small family owned business that relies on repeat and referral business. Each deal is as important as the preceding and or following deal. We make sure every customer is totally satisfied start to finish. WE ACCEPT TRADES PAID OR NOT. WE HAVE AGGRESSIVE FINANCING LENDERS FOR MOST SITUATIONS ZERO DOWN LOANS STARTING APR RATE 2.5% WITH UP TO 75 MONTH FINANCING ON MOST VEHICLES. WARRANTIES AVAILABLE (CAN BE FINANCED WITH PURCHASED VEHICLE). GAP INSURANCE AVAILABLE (CAN BE FINANCED WITH PURCHASED VEHICLE).","https://cdn04.carsforsale.com/3/420970/17238468/1009228614.jpg?dt=021920180554,https://cdn04.carsforsale.com/3/420970/17238468/1009228615.jpg?dt=021920180554,https://cdn04.carsforsale.com/3/420970/17238468/1009228616.jpg?dt=021920180554,https://cdn04.carsforsale.com/3/420970/17238468/1009228617.jpg?dt=021920180554,https://cdn04.carsforsale.com/3/420970/17238468/1009228618.jpg?dt=021920180554,https://cdn04.carsforsale.com/3/420970/17238468/1009228619.jpg?dt=021920180554,https://cdn04.carsforsale.com/3/420970/17238468/1009228620.jpg?dt=021920180554,https://cdn04.carsforsale.com/3/420970/17238468/1009228621.jpg?dt=021920180554,https://cdn04.carsforsale.com/3/420970/17238468/1009228622.jpg?dt=021920180554,https://cdn04.carsforsale.com/3/420970/17238468/1009228623.jpg?dt=021920180554,https://cdn04.carsforsale.com/3/420970/17238468/1009228624.jpg?dt=021920180554,https://cdn04.carsforsale.com/3/420970/17238468/1009228625.jpg?dt=021920180554,https://cdn04.carsforsale.com/3/420970/17238468/1009228626.jpg?dt=021920180554,https://cdn04.carsforsale.com/3/420970/17238468/1009228628.jpg?dt=021920180554,https://cdn04.carsforsale.com/3/420970/17238468/1009228629.jpg?dt=021920180554,https://cdn04.carsforsale.com/3/420970/17238468/1009228630.jpg?dt=021920180554,https://cdn04.carsforsale.com/3/420970/17238468/1009228631.jpg?dt=021920180554,https://cdn04.carsforsale.com/3/420970/17238468/1009228632.jpg?dt=021920180554,https://cdn04.carsforsale.com/3/420970/17238468/1009228633.jpg?dt=021920180554,https://cdn04.carsforsale.com/3/420970/17238468/1009228634.jpg?dt=021920180554,https://cdn04.carsforsale.com/3/420970/17238468/1009228635.jpg?dt=021920180554,https://cdn04.carsforsale.com/3/420970/17238468/1009228636.jpg?dt=021920180554,https://cdn04.carsforsale.com/3/420970/17238468/1009228637.jpg?dt=021920180554,https://cdn04.carsforsale.com/3/420970/17238468/1009228638.jpg?dt=021920180554,https://cdn04.carsforsale.com/3/420970/17238468/1009228640.jpg?dt=021920180554,https://cdn04.carsforsale.com/3/420970/17238468/1009228641.jpg?dt=021920180554,https://cdn04.carsforsale.com/3/420970/17238468/1009228643.jpg?dt=021920180554,https://cdn04.carsforsale.com/3/420970/17238468/1009228645.jpg?dt=021920180554,https://cdn04.carsforsale.com/3/420970/17238468/1009228646.jpg?dt=021920180554,https://cdn04.carsforsale.com/3/420970/17238468/1009228648.jpg?dt=021920180554,https://cdn04.carsforsale.com/3/420970/17238468/1009228652.jpg?dt=021920180554,https://cdn04.carsforsale.com/3/420970/17238468/1009228656.jpg?dt=021920180554"

最佳答案

您可以尝试将 csv 上传到 Microsoft Access 数据库并选择分隔符。整理信息的能力还不错

关于javascript - 有没有办法从 csv 中获取文本格式?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52045555/

相关文章:

javascript - 我如何在第一次迭代时反转 CSS3 动画(而不是第二次迭代)

php - Dompdf 封装 laravel 中其他语言的支持

php - 以 0.1 的步长验证 HTML5 数字输入

javascript - 如何使用 jquery 更改元素类型

javascript - 急速模块命名冲突 : react native app with AWS Service (Amplify Project)

javascript - 将数组传递给过滤方法

php - 获取一个月中的第一个或最后一个星期五

php - 如何修复mysql行中的ENTER键

php - 发送电子邮件按钮

html - 是否有可能在 css3 中完美地复制它?